Reply LinkBack Thread Tools Search this Thread
Old 02-06-2007, 04:58   #1 (permalink)
.simplestick
By the power of greyskull
 
.simplestick's Avatar
 
Join Date: Sep 2006
Location: Canada
Posts: 39
get frame numbers using frame labels

This might seem like an odd question, but I have a giant movieclip and I want to turn it's frame labels into numbers.

I know it sounds silly, "why not just check the numbers and note them down" is what you'd say. Well, the problem is that the numbers are constantly changing each time something is tweeked for animation, or an item is added etc.

Here's what I got
Code:
// actions var frameClip:MovieClip = testClip_mc; var frameLabels:Array = []; var frameNumbers:Array = []; // hide / disable movieclip frameClip._visible = false; frameClip.enabled = false; // push the first frame label, i already know it's "start" frameLabels.push( "start" ); // push remaining frame labels // i know there's 8, and the convention is "scene1", "scene2", "scene3" etc. for( i = 1; i < 9; i++ ) { frameLabels.push( "scene" + i ); } // goto frame labels and push frame numbers into frameNumbers array for( i = 0; i < frameLabels.length; i++ ) { frameClip.gotoAndStop( frameLabels[i] ); frameNumbers.push( frameClip._currentframe ); } // set our movieclip to frame 1 frameClip.gotoAndStop( 1 ); // show / enable our movieclip frameClip._visible = true; frameClip.enabled = true; // trace a labels frame number trace( "scene5's frame number is " + frameNumbers[5] );

of course, any frame that has additional actions get's executed in the second loop, but the clip is disabled and hidden... so this should work, in theory. I'm just wondering if somebody has a better solution.

Last edited by .simplestick : 02-06-2007 at 06:19.
  Reply With Quote
Old 04-06-2007, 05:28   #2 (permalink)
dan
Iris Folder
 
dan's Avatar
 
Join Date: Apr 2003
Location: smokey
Posts: 2,674
Why do you need to do this? Can you not use the frame lables by themselves? Sorry it's not obvious to me from the code above and just thought there might be a better overall solution for your problem?
  Reply With Quote
Old 06-06-2007, 12:02   #3 (permalink)
.simplestick
By the power of greyskull
 
.simplestick's Avatar
 
Join Date: Sep 2006
Location: Canada
Posts: 39
I have this 'frameTo' function ( I think everyone uses something similar ) but sadly it doesn't allow me to do "frameTo( 'label1' );". I'm only able to use frame numbers; While I could probablly define variables for each label, it would still require me to pass through the main clip at least once.

And I'd much prefer to have all my actionscript at the root level.

What I have works... But it's a bit hefty for what it is. Was just wondering if somebody had a better idea
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8