Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-28-2009, 10:26 AM   #1
archloxx
Member
 
Join Date: Sep 2007
Posts: 81
Wink if current frame

hello all

i need help with something... can i refere to current frame with its label?

here is what i want to do: i want to tell flash if the current frame is at "start" gotoAndPlay "animation"



thanx
archloxx is offline   Reply With Quote
Old 01-28-2009, 12:35 PM   #2
asf8
Senior Member
 
Join Date: Apr 2007
Posts: 4,772
Default

Quote:
Originally Posted by archloxx View Post
i need help with something... can i refere to current frame with its label? here is what i want to do: i want to tell flash if the current frame is at "start" gotoAndPlay "animation" thanx
Maybe these will help...
http://www.kirupa.com/forum/showthread.php?t=13177
http://www.actionscript.org/forums/s....php3?t=124615
http://www.actionscript.org/forums/s....php3?t=185084
asf8 is offline   Reply With Quote
Old 01-28-2009, 01:19 PM   #3
DJRoberts
ActionScript Developer
 
DJRoberts's Avatar
 
Join Date: Jun 2008
Location: London
Posts: 428
Default

i dont think you can do that if your "start" label exceeds 1 frame. My suggestion is to add another layer with single blank keyframe cue points and label these "start" etc or whatever you want. Then use:

if(mc._currentframe == "labelName"){
//perform actions
}
DJRoberts is offline   Reply With Quote
Old 01-29-2009, 06:39 AM   #4
archloxx
Member
 
Join Date: Sep 2007
Posts: 81
Default

thanx guys

@DJRoberts: i will try that
archloxx is offline   Reply With Quote
Old 06-19-2011, 09:07 AM   #5
alex_alex
Registered User
 
Join Date: Jun 2011
Posts: 1
Default Hey

Hi there,
I figured out the if statement, but what if I want also the reverse effect?
But let me explain a bit more : I have a mc with an 'in' and an 'out' animation. The frames are labeled "in", "out" and "full". "full" is where the mc is supposed to stop, between "in" and "out". And I would like my invisible button, on release, to play my mc's "in" if the current frame is not "full", and to play my mc's "out" if the current frame is "full".

here's the bit of code I wrote, seems not to work.

ActionScript Code:
inv1_btn.onRelease = function() {     if (tiroir1_mc.currentFrame != "full")     {         tiroir1_mc.gotoAndPlay("in");     }     if (tiroir1_mc.currentFrame == "full")     {         tiroir1_mc.gotoAndPlay("out");     } };

any idea?
alex_alex is offline   Reply With Quote
Old 06-19-2011, 01:41 PM   #6
tacos
Grrrrrrrrreat!
 
tacos's Avatar
 
Join Date: Apr 2007
Location: Montréal, Québec
Posts: 5,473
Default

First with AS2.0 it's _currentframe not currentFrame.

Second, again with AS2.0, you can't check the current frame's label in that manner... You would need to store each frame's label in a variable, and with your if statement check that variable's value...
__________________
WHO I WAS...
BANDS OF THE 80's

Last edited by tacos; 06-19-2011 at 01:45 PM.
tacos 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
Accessing instances on other frames than the current frame snielsson ActionScript 3.0 3 02-24-2008 12:26 PM
Playing a movie clip on mouse over and continue to last frame on mouse out TerrenceJP ActionScript 3.0 1 11-18-2007 09:35 PM
Get Current Frame Number WhoCares357 ActionScript 3.0 3 11-10-2007 02:31 AM
Newbie - moving a specified # of frames ahead of current frame chard ActionScript 2.0 13 05-19-2005 07:27 AM
AS vs Authoring time editing jkok2000 ActionScript 2.0 7 04-08-2005 06:32 PM


All times are GMT. The time now is 10:34 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.