Jump to content

To anyone 12ozers who know about flash..


ledzep

Recommended Posts

I'm working on a project for a class in which I am basically supposed to make a flash movie, basically I have two questions:

 

1. Is there anyway to make a loop that only loops x number of times and then keeps going?

 

 

2.Is there anyway to make an x number of loops that play the same thing at first and then play different things? (for example that they all begin say with the same animation of a guy walking and then go to different animations)

 

 

thanks.

Link to comment
Share on other sites

This forum is supported by the 12ozProphet Shop, so go buy a shirt and help support!
This forum is brought to you by the 12ozProphet Shop.
This forum is brought to you by the 12oz Shop.
Guest imported_El Mamerro

In the simplest of terms:

 

 

1) Declare a variable on the first frame of the timeline:

 

var timesLooped = 0;

 

 

 

2) Start your loop animation on the second frame of the timeline. Name it "begin". On that very frame, write:

 

timesLooped = timesLooped + 1;

 

 

3) On the last frame of your loop animation, write:

 

if (timesLooped >= x) {

gotoAndPlay ("continue");

else gotoAndPlay ("begin");

}

 

 

^In there, x will be the number of times you want it to loop. Every time the movie gets sent back to the beginning for looping, the variable will be incremented by one. Once it reaches the desired number (or higher), the code will tell the movie to go to a frame called "continue", which is where you will begin the remainder of your animation (next step).

 

 

4) Create said frame after the last frame of the animation loop, and drop in the remainder of your animation.

 

 

Ta daa. I'm not sure what it is you're trying to do with your second problem. more details?

Link to comment
Share on other sites

ok the basic idea with the second problem is that I want to make one animation that can branch off into differnt alternate endings.

 

what i want to do is basically:

 

a dude walks and then either he hunts a mastadon, he hunts an armadillo, or he hunts a bird, depending on what the viewer chooses.

 

the order is basically:

 

dude walks

viewer chooses which prey he hunts

dude walks

 

then:

if viewer chooses prey1 he hunts prey1

if viewer chooses prey3 he hunts prey2

and so forth.

 

sorry its kind of hard to explain this way, if you still dont get what im sayin just forget it.

Link to comment
Share on other sites

Guest imported_El Mamerro

Oh, OK, that's simple. I didn't know there was gonna be user interaction. Make different starting frames on the timeline with specific names for each "outcome". Then make buttons that show up at the end of the first animation that, when clicked, send the playhead to the starting frame of choice. If you want the guy to do the same walk AFTER the viewer has chosen, then you wanna do the whole variable schtick again...

 

I can't be more specific right now, cause I gotta go watch the Klitschko fight. And I can't tomorrow cause I'm gonna be drinking on a boat all day. This isn't for Monday, is it? Maybe the heavyLox monster can help you out in the meantime. Sorry.

Link to comment
Share on other sites

nah this isnt due until friday, Im having difficulty getting the first loop thing you said to work, it says that its missing an 'if' for the 'else'.

 

thanks anyways, if anything I'll just have to copy paste the animations (which even though its a waste of time and memory, at least I'll have it done).

Link to comment
Share on other sites

Originally posted by Armenhammer@Dec 11 2004, 08:07 PM

if anything I'll just have to copy paste the animations (which even though its a waste of time and memory, at least I'll have it done).

what up ArmenHammer...

this project must be a school favorite.

i did a project similar to this...

cept with an eyeball who got to either shoot or stab the rival red eyeball, or just try and run home.....

El Mamerro pretty much got you all the info there for the animation...

 

take your layer of the timeline,

break off 3 seperate animations on that layer.

 

label the seperate animation start frames "prey1", "prey2", or "prey3"

make that whole animation including your ending that you'll have.

 

make sure you put a "stop()" action at the end of each respective animation.

or if you'll have them all end at the same ending do a

 

gotoAndPlay ("ending");

with ending labeled "ending"....

 

i just put my two cents in....

maybe i can get some help on a flash project i have due today...

i need some quick code to make my character shoot projectiles.....

someone, anyone?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...