Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-27-2006, 08:44 AM   #1
meredithreuter
Registered User
 
Join Date: Jul 2006
Posts: 5
Unhappy basic actionscript on(release)

basically i'm retarded, and this is probably really simple.

i'm making a photo gallery.. and each picture slides on and off the screen. so i have movies with each photo that slide on (stop) slide off (stop).

so in scene 1, frame 1, "movie_01" starts, then i need it so when you click the next button it slides off.. then goes to frame 2 of scene 1.

the two on(release)'s work fine on their own.. but i don't know how to say after going to *this* do *that*

Code:
on (release) {
	movie_01.gotoAndPlay(13);
}
on (release) {
	gotoAndPlay(2);
}
all help is appreciated!
meredithreuter is offline   Reply With Quote
Old 12-27-2006, 03:48 PM   #2
Kraken
Flash beneath the fathoms
 
Join Date: Apr 2001
Location: Kansas City
Posts: 678
Default

Well, the easiest way would probably be to define a function and a variable on the main timeline that you can call and update from elsewhere. So, something like:
ActionScript Code:
//I always put a pointer to my main timeline: var myroot:MovieClip = this; var currentPhoto:Number = 1; function goMain() {   currentPhoto += 1;   myroot.gotoAndPlay(currentPhoto); }

Then, what you do is in the last frame of your animation, write some code like this to call the correct function:
ActionScript Code:
_parent.goMain();

does that make sense?
__________________
The coolest website ever!
Visit my friend Ray's site.
Kraken is offline   Reply With Quote
Old 12-27-2006, 03:54 PM   #3
Noct
Toys in the Attic...
 
Noct's Avatar
 
Join Date: Oct 2006
Location: NY
Posts: 3,022
Default

What you have is saying "do this, then do that". The problem is that it is happening too fast. (Almost instantly)

What you need to do is delay one action till the other is done.
You could do this using time intervals or "if this is loaded" checks, or, you can do it really easily by putting the the command to start the second action on the final frame of the first.

So...
You script the button to start the animation of movie1 moving offscreen.
You have a script on the final frame of movie1 that says, start movie 2.
__________________
http://rwithers.com
Noct is offline   Reply With Quote
Old 12-27-2006, 04:12 PM   #4
ds.pixeled
Minister of Silly Walks
 
ds.pixeled's Avatar
 
Join Date: Aug 2004
Location: London baby ;)
Posts: 654
Send a message via AIM to ds.pixeled Send a message via MSN to ds.pixeled Send a message via Yahoo to ds.pixeled
Default

You can have multiple commands within one action.

ActionScript Code:
on (release) {     movie_01.gotoAndPlay(13);     gotoAndPlay(2); }

That will do it.
__________________
"Thank you for flying Church of England, cake or death?"
ds.pixeled is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Integrating Actionscript 3.0 and ASP.NET 2.0? TheStranger ActionScript 3.0 3 06-28-2010 03:47 PM
loading order of layers/frames and its effect on actionscript arianhojat ActionScript 2.0 3 09-25-2006 11:55 PM
Converting Actionscript 1.0 to Actionscript 2.0 DNG ActionScript 2.0 5 11-30-2005 07:57 PM
basic animation actionscript krone ActionScript 2.0 16 07-15-2005 12:43 PM


All times are GMT. The time now is 06:48 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.