ActionScript 3.0 :: If Current Frame == 1 Dosomething ... Else (currentFrame ==2) Do Something Else Not Working?

Nov 6, 2009

Im having a little bit of trouble trying to make a button give me different results based on what frame the main timeline is on. I am trying to get a button to go to a different link based on what frame the main timeline is on.  If I am on frame 5 It will trace back "4" .. that is fine but other frames trace back the frame number and also 4.
  
frame 2 click of button traces back 1 and 4
frame 3 click of button traces back 2 and 4
frame 4 click of button  traces back 3 and 4
frame 5 click of button  traces back 4

[code]....

View 8 Replies


Similar Posts:


ActionScript 3.0 :: Dynamic Text Box To Show Current Frame Not Working?

Dec 3, 2009

I would like my dynamic text box to display the roots current frame. I have triedthis with no luck
 
frameNumberText_txt.text = currentFrame;
 
Im pretty sure the problem is because the text field needs a string value..

View 3 Replies

ActionScript 3.0 :: Seek Frame-by-frame The MovieClip Timeline And Use The CurrentFrame To Control All Motion Child?

Jul 16, 2010

i'd like to control MovieClip timeline witch contain several DisplayObject (like Sprite, Button, ...) these DisplayObject have Motion (AnimatorFactory). How can i do seek frame-by-frame the MovieClip Timeline and use the currentFrame to control all Motion child.

[Code]....

View 18 Replies

ActionScript 2.0 :: CS3 Various If CurrentFrame Requests Not Really Working?

Jan 2, 2011

I'm havin 5 button MC's (btn1-5 with animation) in a navi MC also there is a contentHome MC where all my content is. Above my content is a mask which fades the content in and out again.So now I'm trying to tell every button what to do, here's the code I'm using e.g. btn1 which is the home button.[code]but for some strange reasons it's not really reacting to my bio, music, and gallery commands, it keeps running the last command (booking).I must admit I just started using if-commands and all that stuff so I'm kinda new to these things, but I think flash only reacts to the last command and delets the others, because I did something wrong in my code writing, but what is it?

View 1 Replies

ActionScript 2.0 :: If(_root.currentframe Not Working?

Feb 10, 2009

I can't seem to get... if(_root.currentframe to work. It just doesn't seem to recongnise what the _root frame is and won't goto the desired frame.I've attached a simple flash example which is very basic with a button inside a mc that asks the _root for the frame and if it's on frame 1 then should goto frame 5 - but it doesn't work. I've added a trace and that's returning the correct frame so it knows what the frame is.The actionscript on the button is..

on(release){
trace(_root._currentframe);
if(_root.currentframe == 1){

[code]...

View 3 Replies

ActionScript 3.0 :: Always Skips The First Two CurrentFrame If Conditionals And Runs The Last CurrentFrame If Conditional

Mar 5, 2012

I have checked over and over again. But when I run it, it always skips the first two currentFrame if conditionals and runs the last currentFrame if conditional. I have this code in another file and it works perfectly...

[Code]....

View 2 Replies

IDE :: TWEEN From Currentframe To Another Frame?

Feb 26, 2010

I have a movieclip that contains a sequence of jpgs one per frame.When the user clicks a button I would like to use the tween class to move the clip on its x and y axes to a target position but also move the clip's frame from its currentframe to another on its timeline.

var myTween=new Tween(MOV,"x",Strong.easeOut,MOV.x,nx,3,true); //works
var myTween2=new Tween(MOV,"currentFrame",Strong.easeOut,0,260,3,tr ue); //doesn't work

I can tween the x and y properties ok but cannot see how to tween the frames. currentFrame is read only so that won't work.

View 1 Replies

Professional :: CurrentFrame And TotalFrames Not Working As Intended?

Nov 25, 2011

I have a peculiar problem with a swf published from Captivate (full motion recording, single slide). I wish to use the swf in another flash movie, and basically want to have things triggered when the movie has finished playing (like going to the next frame, where I plan to embed another swf). After doing some research, I decided to go with a method in which the movie's current frame is compared with the movie's total number of frames. To my surprise, the trigger occurs after only one second. Tracing the MovieClip(myLoader.content).currentFrame and MovieClip(myLoader.content).totalFrames reveals that the first one stops at 32, and the second one returns also 32 (according to captivate, it has 1411 frames). Yet the movie keeps playing.
 
I'm guessing that I'm referencing the wrong "currentFrame" and "totalFrames", but am completely lost as to why it's not working like it should.

[Code]....

View 2 Replies

ActionScript 3.0 :: MovieClip.currentFrame Traces To A Different Frame Than It's Displaying

Aug 28, 2011

I have a movieclip on the stage with 3 frames. Each frame has a stop(); in the actions layer. I have double (and triple and quadruple) checked the label names.There is a button to toggle between the three frames of the movie clip. A Frame 1 button, a Frame 2 button, and a Frame 3 button. The movie clip (there are lots of them) is then spawned with a mouse click. The movie clips are already declared at the beginng. They are not unlimited so I can just have a for loop go through all of them and change the frame number even before they are spawned and added to the display list.Frame 2 and Frame 3 work just fine. But the button to go to Frame 1 will display Frame 1 on all of the pieces that are already on the stage, but on all new pieces that will be spawned, it just displays whatever other button was pressed last. For instance if I have a movie clip on the stage that's displaying Frame 2 and I hit the buttom for Frame 1, the movie clip will switch to Frame 1. But if I spawn a new movie clip, it will display Frame 2. If I then click back on the Frame 2 button and then again to Frame 1, the movie clip will correct itself.

I can't find where on earth in the code it's going wrong. I've tried using traces but I can't find any problems or inconsistencies. Everywhere I put a trace to tell me what frame the object is at, it traces correctly. I'll click on Frame 1 button, then click on the stage, and it will trace to the output menu that the current spawned movie clip is on Frame 1 when it's very clearly displaying Frame 2.[code]

View 2 Replies

ActionScript 2.0 :: Currentframe - Send Movie Clip To A Specific Frame On The Main Timeline When Close

Jun 25, 2006

I have a movie clip which, when closed, should send you to a specific frame on the main timeline... I have used frame labels on the main timeline... Here is a bit of my code so far:

[Code]...

View 5 Replies

Actionscript 3 :: Stop Movie (from Current Frame) Playing When I Click On Next Frame?

Apr 8, 2010

I have four movie clips (.f4v) in 4 frames in a movie with watch buttons.. This movie has them been imported into a main movie container that has next and previous buttons. However if i play a movie then hit next frame, the movie continues to play in the background. The code below shows one of the actionscripts for a movie clip and then the main actionscript in the main movie.[code]...

View 1 Replies

ActionScript 3.0 :: Listen For The Frame Number And Display Current Frame?

Nov 17, 2009

I 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.

View 4 Replies

ActionScript 3.0 :: Track Y Coordinate, Then DoSomething?

Nov 12, 2009

I am trying track to see if mouse is between 0 and 200 pix in the Y coordinate, then do an if statement.

stage.addEventListener(MouseEvent.MOUSE_MOVE, mousePosition);
// I use this to track readings.
function mousePosition(event:MouseEvent) {

[code].....

View 3 Replies

ActionScript 2.0 :: [FMX] CreateThisMovieClip And DoSomething.onRelease?

Mar 1, 2004

Why doesn't this code work correctly for the onRelease?

createEmptyMovieClip("MC", 1);
MC.loadMovie("MC.swf", "_root.MC");
MC.onrelease = function() {
trace("hello world");

[code]....

Creative minds have always been known to survive any kind of bad training.

View 13 Replies

ActionScript 2.0 :: Create MovieClip And DoSomething OnRelease?

Mar 1, 2004

Solve one problem. Still have another. Why doesn't this code work correctly for the onRelease?

createEmptyMovieClip("MC", 1);
MC.loadMovie("MC.swf", "_root.MC");
MC.onrelease = function() {
trace("hello world");
};

Creative minds have always been known to survive any kind of bad training.

View 13 Replies

IDE :: How To Get Current Frame

Feb 23, 2008

Is there a way to grab the current frame number?

View 3 Replies

ActionScript 2.0 :: Lock Instance-name For Working In Current Swf?

Mar 3, 2005

Is there a way to lock instancename in a swf to prevent it conflict with other swf, when they are loaded in mainmovie.Say I have this string: in both b.swf and c.swf. And they are loaded up at the same time in a.swf.

loadMovie(this.pathToPicsJan+this.pArrayJan[0], _root.photoJan);

Somehow the mainmovie get confused with the instancenames. Is there a way to get around with this so I don't have to rename each name?? It would b such a hassle to rename all instancenames if I got many duplicated/similar swfs.

View 2 Replies

ActionScript 2.0 :: Lock Instancename For Working In Current Swf

Mar 3, 2005

Is there a way to lock instancename in a swf to prevent it conflict with other swf, when they are loaded in mainmovie.

Say I have this string: in both b.swf and c.swf. And they are loaded up at the same time in a.swf.

loadMovie(this.pathToPicsJan+this.pArrayJan[0], _root.photoJan);

Somehow the mainmovie get confused with the instancenames. Is there a way to get around with this so I don't have to rename each name?? It would b such a hassle to rename all instancenames if I got many duplicated/similar swfs.

View 2 Replies

Get The Current Frame Of A MovieClip?

May 16, 2011

how can I get the current frame of a MovieClip.It's an animation that just loops over and over when its opened with ctrl+enter.On the stage its just one layer and one frame, but when it's double clicked, it has its own timeline with 20 frames.

Actionscript Code:
//what i had but it shows frame 1trace(myMovieClipInstance.currentFrame);

display the current frame when it changes. So something with a while loop. Like while the movie clip is playing, display the current frame.

View 4 Replies

ActionScript 2.0 :: Take Off From The Current Frame?

Jul 28, 2005

I can get this code to work, how far off am I? it is just taking me to the first frame, i want it to take off from the current frame.

on (press) {
oot.gotoAndPlay(_currentframe);
}

View 1 Replies

ActionScript 3.0 :: How To Get Current Frame

May 27, 2009

How to get the current frame? At first its in the starting frame. What I want to do is when I press Enter gotoAndStop(3); and again pressing enter key and if its in frame 5 gotoAndStop(5); etc. So how to know which frame I'm in at the present moment? One way I did is giving all the keyframes (3, 5, etc) a particular label and check using 'currentLabel == 3 ,..etc'. But is there any way to do it without giving it a label by merely using the keyframe numbers?

View 5 Replies

Flex :: Current Theme Spark Styles Not Working

May 2, 2011

I am trying to figure out why I am getting an error when using the chromeColor (or other spark style related items):
<s:Button x="10" y="208" label="CALL" width="185" fontWeight="bold" id="bCall" chromeColor="#F90000"/>

This is the error:
The style 'chromeColor' is only supported by type 'spark.components.Button' with the theme(s) 'spark'.

Yet in project - properties, the theme is set to Spark. I also tried setting it to Halo and then back to Spark. Here is my app definition:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="[URL]"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="800" minHeight="600" width="100%" height="100%">

I have seen references that define the mx namespace as "xmlns:mx="library://ns.adobe.com/flex/halo", but then my mx components break (TabNavigator for example) - not sure if that would fix it anyway. I is using flex 4.1 library (I believe the project was originally created when flex builder was at 4.0 if that matters).

No other libraries included.
Project - properties is set to MX+Spark.

Also, if I remove that chromeColor, the project compiles, BUT there are warnings such as: The style 'borderAlpha' is only supported by type 'spark.components.TitleWindow' with the theme(s) 'spark'. Flex Problem (and others - borderColor, cornerRadius, dropShadowVisible).

View 2 Replies

AS3 :: Display Current Frame Number?

Jan 9, 2009

I 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]....

View 4 Replies

ActionScript 2.0 :: CS3 - Get Current Frame Label?

Mar 5, 2009

I have labeled my frames in the timeline. Is it possible to retrieve this labels in an onEnterFrame function?

I can use this but it only returns frame numbers:

code:
this.onEnterFrame = function() {
trace('current frame:' + this._currentFrame);
};

View 2 Replies

ActionScript 3.0 :: MovieClip Get Current Frame

Feb 3, 2010

Is there a way to get he current frame of a movie clip that is playing? For example I have myClip which is a MovieClip, and the code is myClip.stop(); Is there a way to know which frame myClip stopped on? Such as frame 5 or 10 or so?

View 1 Replies

Flash :: Only Add Child To Current Frame?

Sep 28, 2011

Is it possible to add a child to the current frame only?

I know you can just remove/hide them, and generate/show them again.

But isn't there an easier way?

View 2 Replies

Flash :: Reload Current Frame?

Apr 23, 2009

What's the sanest way to achieve something along the lines of this.gotoAndStop(this._currentframe)?

What I want is that Flash re-loads the current frame as if I was using gotoAndStop (which does nothing if it is given the current frame as target frame).

View 2 Replies

ActionScript 3.0 :: Only Apply To The Current Frame?

May 29, 2010

is it possible to make my code only apply to the frame it is written on (not inherited by the other frames). How can i remove the default inheritance?

View 4 Replies

ActionScript 3.0 :: Get Seconds Of Current Frame?

Jul 18, 2010

I just want a simple way to get the seconds of the current frame when playing the swf.

It's purely for debugging purposes

View 1 Replies

ActionScript 3.0 :: Reload Current Frame?

Mar 11, 2011

When an animation stops, I need to give the user a way to again view the animation.Is there a way in AS3 to reload (or refresh) the current page I tried gotoAndStop(1), but the variables are not reset.

View 0 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved