ActionScript 2.0 :: Get Frame Number By Name?
Aug 16, 2009If I know a frames name, is it possible to get the frame number from the frame name?[code]...
View 9 RepliesIf I know a frames name, is it possible to get the frame number from the frame name?[code]...
View 9 RepliesI have tried this a dozen different ways and I really am at my wits end.
I have a presentation that works like a powerpoint. Everything is working as it should, except one part. I have a movie clip with an instance named slides, and I want to actively display which frame number you are in this move clip.
I have tried more than one why but I see no reason why this should not work:
var frameNum:Number = this.slides.currentFrame;
this.frameText.text = "P�quina " + frameNum + " de 173";
It appears to work at first, but does not update when I navigate the slides. It constantly says 1. Before I just added a function to the back and next buttons to frameNum++ and frameNum--, but after I created the Menu I would prefer it to automatically detect what frame it is on.
I created the following AS for a particular frame
Code:
cnx.addEventListener(CNXConnection.DIGITAL, onDigital_10);
function onDigital_10(e:DigitalEvent)
{
[code]....
While debugging everything works properly if I'm testing that frame.But, pushing a button in another frame, I get the following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference at "frame number:raw number"
I'm quite sure that the problem is that the variable e.Join changes its corresponding e.Value pushing a particular button in another frame (as must be). Any ideas how to link that information to the frame that create the error?
I am trying to use this if statement with a frame label instead of a frame number. I believe that _currentframe is looking for a number only. Is there a different command that looks at frame labels instead of frame numbers?
View 1 Repliesis it possible to find the frame number of frame label with AS if a button is rolled over, the timeline jumps to a label - which plays a set of 3D rendered frames to 'raise' and element, once a user rolls out of the 'button' area the button is meant to 'lower' - which can be done by simply playing backwards to the previous label.
View 5 RepliesI am trying to use this if statement with a frame label instead of a frame number. I believe that _currentframe is looking for a number only. Is there a different command that looks at frame labels instead of frame numbers?
View 1 RepliesIs there a simple way to get the frame number of a frame label?
View 2 RepliesI feel like such an idiot but after trying endlessly I still haven't managed to come up with a way to display the current frame number of nested movie clip ("ecke1") (in a dynamically created text field).The problem really is that I don't know how to have flash keep updating the variable. Here's my latest attempt:
Code:
var frame:int = 0;
addEventListener(Event.ENTER_FRAME,updateframe,false,0,true);
[code]....
I want to change the text of a dynamic text box based on the frame number. Something like this:
Code:
if (_currentframe > 222 && _currentframe < 2222) {
txtMessage.text = "Pump turned on";
}else{[code]......
But this doesn't work.
Is it possible to find out the first frame of a label without going there then put it in a variable in AS2 or AS3?
View 2 RepliesI'm having difficulty searching it since keyword frame brings up everything. I'm looking to reference the frame number in an if statement.
A small note I'm doing this cause the listeners I'm using to target key presses are interfering with each other when, even when the actionscript is on different frames.
Is there a simple way to get the frame number of a frame label?
I have a bunch of labels on a long timeline, but want to create some calculations based on the number of frames between labels.
I would like to use a conditional to determine if my location is before or after a frame.However, to make it portable I would like to base it on the label name.e.g.
if (_currentframe < "p2")
however, "p2" is the label of a frame.So how do I get the frame number from the frame label? I am making something that when it detects a click, jumps to the next point in the movie. These P1,P2, etc. will be distributed through the movie.
'if jump detected'{
if (_currentframe < "p2"){
gotoAndPlay("p2");
} ELSE IF (_currentframe < "p3") {
gotoAndPlay("p3");
I guess the problem with this is what if the one of the movies isn't as long and doesn't have a "p4" location for example.Probably I can handle this case when I am setting up the variables that contain the frame number of "p2", "p3", etc... checking agains the max number of frames.
I dont know if it sound stupid if i ask this kind of question as i really dont know how to address frame number below is the code, i have movie clip, i set a condition tat if apple equal true and also if the movie clip inside the movieclipball's frame reach frame 25, the movie will play.[code]
View 1 RepliesCan a rollover go to a different frame number...
View 2 RepliesThe first Scene of my movie has a video that is streaming on frame one what i would like to have happen is once that video is completed then the flash takes you to the next scene of a specific frame Number.
View 3 RepliesI am making a website, I have a loaded swf that I want to animate off screen AND THEN unload on a button click, the home button in this case. I have had a shot at making this happen but to no avail.This is the code I have, which currently doesn't work. The function 'frame30' does not fire. I have annotated it so you can see what works and what doesnt.[code]
View 1 RepliesI have a timeline slider part to my animation which starts at frame 1089 and ends at frame 1173, I have a script which allows me to do this and works perfectly when I build it in a new flash file starting at frame 1, I need this code to work for the animation I have built at frame 1089, I dont know which number "1's" in the script relate to the frame number, I have tried changing them all to 1089 but that doesn't work! at the moment as soon as I click on this it jumps back to frame number 1 - which I believe as the code stands is exactly what it should be doing. Please could anyone edit this code so that it realises which frames I want it to work in?
var numOfFrames:Number = 85; // number of frames in the timeline to scrub
var widthOfScrubber:Number = 500; // width in pixels of scrubber bar
var widthOfScrubberSlider:Number = 25; // width in pixels of scrubber slider[code].....
I would like to use a conditional to determine if my location is before or after a frame.However, to make it portable I would like to base it on the label name.if (_currentframe < "p2")owever, "p2" is the label of a frame.o how do I get the frame number from the frame label?I am making something that when it detects a click, jumps to the next point in the movie. These P1,P2, etc. will be distributed through the movie.
Does this sound like the best idea?
'if jump detected'{
if (_currentframe < "p2"){
[code].....
I have a timeline slider part to my animation which starts at frame 1089 and ends at frame 1173, I have a script which allows me to do this and works perfectly when I build it in a new flash file starting at frame 1, I need this code to work for the animation I have built at frame 1089, I dont know which number "1's" in the script relate to the frame number, I have tried changing them all to 1089 but that doesn't work! at the moment as soon as I click on this it jumps back to frame number 1 - which I believe as the code stands is exactly what it should be doing. Please could anyone edit this code so that it realises which frames I want it to work in?
var numOfFrames:Number = 85; // number of frames in the timeline to scrub
var widthOfScrubber:Number = 500; // width in pixels of scrubber bar
var widthOfScrubberSlider:Number = 25; // width in pixels of scrubber slider
[code].....
I want to change the text of a dynamic text box based on the frame number. [code]...
View 4 RepliesWhat is the actionscript 3 syntax for retrieving the frame number that our object is currently in ?
View 2 RepliesI want to addChild at certain frame say 130. And I used the following format
var btn1:Button = new Button();
gotoAndPlay(1);
addings();
[Code].....
put and even I can't get the trace result. how to add childs at any frame number I want
I want to get the current frame and current scene because I want to be able to return to that same exact scene and frame when I click a button that goes to a different scene. When I click a button that says "Exit" I want to go back to the same spot as before.
View 1 RepliesI'm stuck on this annoying bug of Flash:to animate a character i have different graphic symbols of hand positions inside a single container graphic symbol; that way instead of having to swap different symbols while animating and tweening, i just have to change the number on the "single frame" input box on the properties of the symbol.
It worked fine a few sessions ago, but now it won't let me change the frame number if there's a tween before that keyframe; tha keyframe isn't participating on any tween, and may even have some frames between the previous tweening one. The only way it will change is if i remove the first tween or add a blank keyframe between them, wich of course isn't an option when animating... i know it would work if i add a new layer and continue there, but it'll add a lot of mess to the already busy timeline.
The strange thing is that it remains working on some frames, from the previous session, and if a cut and paste them i can change the frame number freely; but if i try to build a secuence from scratch, it won't let me, even on a new document.
I have a movieclip placed in the main timeline. Inside that movieclip, there is another movieclip.I need to know the current frame number of the inner movieclip when the animation is playing.And report that current frame number back to the actionscript in the main timeline.
View 2 RepliesIs there a way to get Flash to know what frame it's on and pass that as a variable? I can't use counters because I'm using a random frame function.
View 3 RepliesIs it possible to create a link on an html page that when clicked will load a new page, which has a flash movie on it, but make the flash file jump to, say frame 50, or a frame label?
View 2 RepliesI have a gallery controlled by 4 buttons. The images are loaded by XML and have a timeline animation. So they slide in and out.I want to add an event listener to the buttons so they finish playing the movie before loading the new image. Can an event listener listen for a frame number in a MC?[code]
View 1 RepliesI am struggling trying to get this variable set. I want to set a variable number to be the frame number of a movieclip. this is what i am trying with no luck:
var fn:Number = movie_name._currentframe();
trace(fn);
I have looked at different online examples but cant find an example like this one.