PDA

View Full Version : complex gallery explaination


cuse
05-27-2003, 10:52 AM
Hey...

Wondered if anyone knew a good way to begin this. Or if you have seen anything like this around?

Basically (thats a joke already...)

i have three words aligned vertically, they give the explaination of an image above, when an arrow is pressed either side of teh image, either left or right, the explaination is changed.

The thing is, the explaination changes by 'breaking up' or 'exploding' if you will...

A quick 'diagram' of sorts to explain (right on over HERE (http://www.showyourtruecolours.com/txtex-cess/))

So, i've been told already that it would probably mean taking every letter of the alphabet, break them up into basic components, such as lines and curves.
Make eac of these into MovieClips.
Then ill need some kind of two-dimensional array detailing each character and how theyre constructed in terms or my elements.

Then i would need to have a developed, pretty complex algorithm that compairs the component of one word with the components of another. Then decides what can be swapped for what, and what needs to be created/destroyed.


Well. thats its, let me know what you all think...



cuse

DainBramaged
05-27-2003, 03:58 PM
Sounds like you have your hands full with this one.

If the words are breaking apart (exploding) into separate letters, but the letters are remaining intact (the letters themselves are not breaking apart--just the words made from said letters), then you will not need to break the individual letters into curves. You can make separate clips of each letter in the alphabet. Your programming would be easier then because you just compare the results of one string and assemble the new string from the results. The next tough part would be getting the character spacing correct.

I'm assuming that you are going the actionscript route because the text will be updated regularly?

cuse
05-27-2003, 04:15 PM
Exactly right DainBramaged. I need to update the text possible Bi-monthly intervals so Actionscript is the way to go.

Trying to rack my brains with this and too much other stuff... any thoughts on coding this? I think i know how i could get around the character spacing but help... :)

thanks for the response.



cuse

DainBramaged
05-27-2003, 07:50 PM
Well, I've never done this before, but I would guess:


1) Use AS to convert each text object you will be duplicating to an Array (String.split). That way you can access each character in the proper order when you duplicate them into their new location.

2) Create a MovieClip with an empty Dynamic text box in it.

3) Set up a loop to duplicate your MC with enough text boxes to hold your text:
(for (var i=1; i<=100; i++) {
sum = sum + i;
} )
i<=100 would be replaced with the length of your array.

Then update each instance with a variable that matches each box to it's corresponding index in the array.

4) Set up your positioning for the movie clips.

4) Set up your trigger for the explosion, either using a timer or an action (however you envision this).

I know there are tons of holes to fill, but maybe this is a jumping-off point.

Let us see how this progresses!

Dain

uberslayer™
05-27-2003, 09:30 PM
sheesh. These frickin' guru's make you sick don't they.;)

DainBramaged
05-27-2003, 09:40 PM
Originally posted by uberslayer™
sheesh. These frickin' guru's make you sick don't they.;)


gurus......[giggles].....Gurus!!??? he he he GURUS??!!! buahahahahahahahahahahahahahahahahahahahhahahahahaahahhahahahahah
[deep breath]
AHAHAHAHAHAHAHAHAHAHAHAHAHAAAAAAAAAAAAAA
[wipes tears away]


good one.... :D

Cheers,
Dain

cuse
05-28-2003, 09:39 AM
Hey thanks for the reply Dain.

I have been trying to get more into OOP and confusing myself a lot recently, so excuse me if i do it to you now... :)

Anyway, i did think i would be creating all my characters of the alphabet and converting them into array's. But now im confused, what are you using the dynamic text box for? Im trying to get my head around it all cause im working on quite a few things at once and theyre not all specifically flash.

Plus, im not too up on for loops at the minute, the condition i<=100 will be replaced with the length of the array. any chance you can go into that at all, would be a big help???...

thanks again.


cuse

DainBramaged
05-28-2003, 05:15 PM
I typed and typed and typed. I checked and rechecked. Every time I read what I typed, I realized I was probably just making more questions.

The short of it is:

You MAY not have to create an array of all the upper and lower case characters. You may be able to create a movie clip of a single letter and duplicate it to the correct number of letters to make up the word, updating each clip to its appropriate letter. For example:

MC on stage of letter "f". (you want to spell freak). So you duplicate it 4 times to total 5 clips. Then you tell each dynamic text box what letter it is supposed to be. Box 2 will be "r", box 3 would be "e" and so on. You get the letter you want from your variable for the current word. So:
word3="freak";
word3.charAt(2) will return a value of "e". (It is indexed like an array so the starting value is zero. charAt(2) will return the third letter...zero, 1, 2.)

To know how many movie clips you need to duplicate, you can use String.length. That will return the actual number of characters in the string, so you know that you have your first letter and need the string.length minus 1 to total the right number of letters.

Duplicating the right number of clips goes something like this:
on (release) {
currentword++;
amount = (eval("_root.wordlength" + _root.currentword))-1;
while (amount>0) {
duplicateMovieClip (_root.lettermc, "lmc"+i, i);
setProperty ("lmc"+i, _x, random(275));
setProperty ("lmc"+i, _y, random(275));
i++;
amount--;
}
}
Currentword tells flash which word you are updating, so the same button will work again and again, updating to the next word. Amount is the number of movie clips you need to create to make your word. Remember, you already have one on stage, so you need one less. You'll have to remove the movie clips on press also...that action should come right before you make the new ones. Or you might experirment with trying to load the clips into the same level over and over, replacing the old clips (only 1 cli is allowed per level...if you put another clip in a level, it overwrites the old one.--I think just removing them all and starting fresh is simpler--not necessarily better) The setProperty is to place the clips. These are set to random positions, but you can tweak that after you get it working....one step at a time, eh? :)

After you get the button working to update the number of text boxes (inside mc's) and the letters in the boxes, you can turn the code into a function and call it whenever needed, like to initialize your first word or every time a mouse click occurs...just wherever you need it. Make sure you don't include the currentword in the function, though. That should only be on the mouse events.

Hope I haven't totally confused the situation. Again, this is new ground for me too.

Dain

CGTalk Moderation
01-15-2006, 06:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.