Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-27-2006, 08:44 AM   #1
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*

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

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:

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
Toys in the Attic...
Noct's Avatar
Join Date: Oct 2006
Location: NY
Posts: 3,035

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.

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.
Noct is offline   Reply With Quote
Old 12-27-2006, 04:12 PM   #4
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

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

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 02:47 PM
loading order of layers/frames and its effect on actionscript arianhojat ActionScript 2.0 3 09-25-2006 10: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 11:43 AM

All times are GMT. The time now is 11:21 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2015, 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.