Be a Supporter!

_currentframe and Frame Labels

  • 309 Views
  • 10 Replies
New Topic Respond to this Topic
2-3-ryan-5
2-3-ryan-5
  • Member since: Feb. 10, 2008
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
_currentframe and Frame Labels 2011-09-01 12:08:54 Reply

What I'm trying to do is get
if (this._currentframe == ###) {
only instead of having to put the number of the frame, get it to search for the frame label
AS 2.0 by the way
is this possible?


Flash ROCKES!!!!!!

BBS Signature
Sandremss128
Sandremss128
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Supporter
Level 11
Programmer
Response to _currentframe and Frame Labels 2011-09-01 12:48:18 Reply

In actionscript 3.0 this is very possible and there is nice support for it, I did some research and found out that there is no way to get the currentLabel like you can in AS3. So you need to make your own framelabels and store them in your class. A 'fix' is to initialize your code something like this:

//init code
public function init():void
{
   var myFrameLabel:String == "blahblahFrame";
   gotoAndStop(myFrameLabel);
   myFrameLabelPosition = _currentFrame;
   gotoAndStop(1);
}

Its not pretty but I think that the only way to store the position of a framelabel is to convert it to the frame number and then use that to check it. OR you go learn AS3 ;)

2-3-ryan-5
2-3-ryan-5
  • Member since: Feb. 10, 2008
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to _currentframe and Frame Labels 2011-09-01 13:28:47 Reply

I would Lear AS 3.0 if only i had 600$ for a better version of flash
but thanks for the info


Flash ROCKES!!!!!!

BBS Signature
PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to _currentframe and Frame Labels 2011-09-01 13:52:13 Reply

At 9/1/11 01:28 PM, 2-3-ryan-5 wrote: I would Lear AS 3.0 if only i had 600$ for a better version of flash
but thanks for the info

Maaayn, just get FlashDevelop and the Flex SDK...I get ticked off hearing how everyone complains about needing to pay for a newer Flash version when using the latest Actionscript is just 2 downloads away...

2-3-ryan-5
2-3-ryan-5
  • Member since: Feb. 10, 2008
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to _currentframe and Frame Labels 2011-09-01 23:32:15 Reply

At 9/1/11 01:52 PM, PSvils wrote:
At 9/1/11 01:28 PM, 2-3-ryan-5 wrote: I would Lear AS 3.0 if only i had 600$ for a better version of flash
but thanks for the info
Maaayn, just get FlashDevelop and the Flex SDK...I get ticked off hearing how everyone complains about needing to pay for a newer Flash version when using the latest Actionscript is just 2 downloads away...

Well mabey you should think about mabey I'v never heard of FlashDevelop or Flex SDK,
because I haven't.


Flash ROCKES!!!!!!

BBS Signature
Sandremss128
Sandremss128
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Supporter
Level 11
Programmer
Response to _currentframe and Frame Labels 2011-09-02 05:32:13 Reply

Now you did, so go learn it :p

bikinigames
bikinigames
  • Member since: Aug. 26, 2011
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to _currentframe and Frame Labels 2011-09-02 13:27:40 Reply

There is absolutely a way to locate frames according to their frame label in AS2.

onEnterFrame=function(){
if(_currentframe=="framelabel"){
dostuff();
}
}

2-3-ryan-5
2-3-ryan-5
  • Member since: Feb. 10, 2008
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to _currentframe and Frame Labels 2011-09-02 14:01:02 Reply

At 9/2/11 01:27 PM, bikinigames wrote: There is absolutely a way to locate frames according to their frame label in AS2.

onEnterFrame=function(){
if(_currentframe=="framelabel"){
dostuff();
}
}

That dosen't work.
It was my first guess but no.


Flash ROCKES!!!!!!

BBS Signature
bikinigames
bikinigames
  • Member since: Aug. 26, 2011
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to _currentframe and Frame Labels 2011-09-02 23:28:03 Reply

You are applying it wrong then, I just tried it.

Sandremss128
Sandremss128
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Supporter
Level 11
Programmer
Response to _currentframe and Frame Labels 2011-09-03 04:30:46 Reply

But if you trace out the _currentFrame property you will get a numeric value. It doesnt make sense that if you check this numeric value against a String value you get a positive check.

Sandremss128
Sandremss128
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Supporter
Level 11
Programmer
Response to _currentframe and Frame Labels 2011-09-03 04:34:27 Reply

Here is the FLA file I made that uses your code to check for framelabel and it doesnt work:

http://www.newgrounds.com/dump/item/1780 6020e93a705d4707cdd88810b8dc

(Flash CS4)