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


Similar Posts:


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

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 :: 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

ActionScript 3.0 :: _root.MyVar Not Working ?

Feb 1, 2010

if i have embeded swf like myswf.swf?myVar=test.txt ,i get by _root.myVar (test.txt)how can i get this parameter in AS3? I have searched google but no success

View 3 Replies

ActionScript 2.0 :: If (_root._currentframe != 6){ Is Not Working?

Jan 8, 2007

this code should work, but doesn't. Am I missing something? I'm simply trying to disable the button "cardSearchBtn" when the root timeline enters frame 6 (along with two other play actions).

Code:
if (_root._currentframe != 6){
cardSearchBtn.enabled = true;[code].........

View 2 Replies

ActionScript 2.0 :: Referencing Something In _root Not Working

Nov 13, 2007

I have a class 'resizingObject', with a method 'addFunction()', which is instantiated in _root as 'resizer' (im certain of this - ive checked in the debug - variables list)

I then have another class, 'layerObject', that i want to be able to call the 'addFunction()' method - so inside the layerObject i tried _root.resizer.addFunction(), _level0.resizer.addFunction() and all manner of other business but to no avail...even an attempt to trace _root.resizer returns undefined.

why cant i acces the resizer instance of the resizingObject?

View 1 Replies

ActionScript 2.0 :: _root.onLoad Not Working In Firefox?

Mar 4, 2005

I have a very, very simple thing in Flash that just will NOT work in Firefox and it's driving me nuts. On the very first frame of the root, I have the following code:

Code:
this.onLoad = function() {
_root.createTextField("test1_txt", 10000, 0, 0, 300, 100);
test1_txt.text = "WORK!!!";

[Code]....

This works all right but again, it's a hack, and I'd rather avoid using a hack like this.

View 1 Replies

ActionScript 2.0 :: OnClipEvent + _root = Sliding Pages Not Working

Feb 2, 2009

I'm having a tough time with a page sliding clip, and not sure what to do.

I've got a movieClip with a page sliding effect that I found here at Flash Kit. It's perfect for what I need, however the effect will only work in that movieClip. Once you try to load that movieClip from anywhere else, the sliding no longer works.

Here's the code that's on the image clip:

Code:
onClipEvent (load) {
_x = 0;
_y = 0;
spd = 5;

[Code]....

View 1 Replies

ActionScript 3.0 :: _root, _level... Not Working In Loaded File?

Feb 5, 2009

I have loaded as2 swf in as3 using Loader object. Loading is done fine, but the problem is that the as2 swf uses stuff like _root, _level1.. etc. that doesn't work in as3. So is there any way by which I can make as2 swf work properly inside as2? I have bought some readymade as2 swf and need to use them here. I dont have the as2 fla so can't make any changes in them...

View 9 Replies

ActionScript 2.0 :: Change The _root.broj And _root.logo Variables Inside The Function?

Jan 14, 2010

In the code below i want to change the _root.broj and _root.logo variables inside the function which returns values from .php file. Inside the function everything works fine and all values are correct but when i trace var broj outside the function it's still 0.

var result_lv:LoadVars = new LoadVars();
var send_lv:LoadVars = new LoadVars();
var broj:Number=0;
var logo = new Array();

[Code].....

View 1 Replies

ActionScript 2.0 :: _root.cargo Are Multipled By 10 And Added To _root.totalscore?

Feb 27, 2003

im lookin to make this so that the points taken from the _root.cargo are multipled by 10 and added to _root.totalscore

[Code]...

View 2 Replies

ActionScript 2.0 :: _root._root[eelmine].nextFrame()?

Sep 14, 2004

if a condition is true, then:_root.(MC with instance name that is the value of "_root.eelmine").nextFrame(); is this correct?_root._root[eelmine].nextFrame();

View 16 Replies

ActionScript 2.0 :: _root - Load Swf Into Another With "loadmovie" With An Empty MC The Pages Stop Working

Nov 14, 2004

Im new in actionsript and I have a problem with _root. I have a swf. with two MC en the main stage: Mc_menu and Mc_pages. The Mc_menu has several buttons with the code "_root.pages=2" which moves the different pages that are in the Mc_pages. If I publish the fla. it works perfectly. Now, when I wanted to load this swf into another with "loadmovie" with an empty MC the pages stop working... I guess is because of the rutes, but i don�t know how to refer them correctly. What I have right now is: in the main stage an empty MC and a button with the code:

[Code]...

View 2 Replies

ActionScript 1/2 :: OnLoad Working At _root Level But Not At Mc_target Level?

Aug 26, 2010

I have two layers in my FLA both with empty movie clips as follows:In mc_Empty1, I attach a faded background movieclip as I wait for mc_Empty2 to load a SWF.  Once the SWF is loaded into mc_Empty2, I want to remove the faded background movieclip from mc_Empty1.  When I load the SWF from the main timeline, the onLoad() function works and removes the faded background from mc_Empty1.  However, when I load the SWF from mc_target, the SWF loads, but the onLoad() function does not.  Here's my AS2 code:
 
//Loading SWF from main timeline
mc_Empty1.attachMovie("mcFadedBg", "mc_FadedBg", 1);
mc_Empty2.loadMovie("My.swf");mc_Empty2.onLoad = function():Void{    trace("loaded"); //This works    removeMovieClip(mc_Empty1.mc_FadedBg); //This works}

[code]....
 
I know I'm targeting properly because the SWF loads as it should, but the onLoad() function does not. 

View 3 Replies

ActionScript 3.0 :: No Longer Move The "_root" By Changing The _x And _y Positions Of The _root?

Jan 26, 2009

I just recently began migrating from AS2 to AS3, and I have of course realized that I can no longer move the "_root" by changing the _x and _y positions of the _root (which no longer exists in AS3). How can I do this in AS3 (specifying _x, _y, _z possibly of the "_root")?

View 2 Replies

ActionScript 3.0 :: Currentframe For All Scenes?

Feb 9, 2010

I am coding this loader that requires multiple Scenes because of long swf presentations. My loader swf is using a timeline scrubber and I am having problems when dealing with Scenes because the currentframe goes back to "0" when a new scene starts and scrubber goes back to the beginning.

View 1 Replies

ActionScript 1/2 :: CurrentFrame Detection?

Jul 19, 2009

I have an if statement set up for the rollout on a button:

on (rollOut) {
if (_root.mb == false) {
copymb.gotoAndStop('off'); } else if (copymb._currentframe ==

[code]....

View 2 Replies

As :: Flash - CurrentFrame Identifiers?

Feb 19, 2012

I'm completely new to Flash and AS3, and I'd have thought this would be a simple question, but I've been unable to find an answer online or in the documentation. I'm trying to use addEventListener (Event.ENTER_FRAME) and (.currentFrame) to disable a button for part of an animation sequence. While the animation sequence fades in, the Button Hand cursor is visible and people can select it before the sequence is completed. I want this button disabled for the first 213frames of the main timeline, which is when the button becomes visible.Earlier, I was successfully able to disable a Rewind button for parts of a different movie scene using the code below with a few insignificant things changed.

Skip_btn.addEventListener(MouseEvent.CLICK, SkipToGoToScene);
function SkipToGoToScene(event:MouseEvent):void
{

[code].....

View 1 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

ActionScript 2.0 :: CurrentFrame From A Separate Movieclip?

Jun 11, 2009

I am building a gallery that displays images. There is a gallery movie that controls which image is displayed. It is on level 2.

The images are on loaded in movieclips onto level 3. What I am trying to do is create back and forward buttons that load with the images.

What I'm trying to do is get the button that loads with the images (on level 3) to send a command to the movie clip on level 2 top move forward twelve frames.

I've tried using currentFrame to get the clip to move forward, but it I can't get it to work properly. Here's what I have (this is all AS2 in CS4):

(this is on the button on level 3)

on(release) {
_level2.clip.gotoAndPlay(currentFrame + 12);
}

What seems to be happening is the currentFrame is being defined as the frame on level3 that the button is on. Flash takes that frame number, adds 12 to it and then moves the clip on level 2 forward that many frames. So if my button on level3 is on frame 2, the clip on level2 gets moved 14 frames.

What I need to happen is for the currentFrame to refer to the current frame on level2, not the current frame on level3.

View 2 Replies

ActionScript 3.0 :: Functions Controlled By CurrentFrame

Oct 29, 2009

I know that the functionality of the addChildToStage and deleteChildFromStage functions works fine because I have tested it here:URL...the nav adds a new instance of "player" to the stage and the big red button deletes "player".I want to start the movie with a mc_CopyBlank on stage and then have the nav issue play(); command to the movie clip held in "player" then have the current frame of that clip trigger the addChildToStage and DeleteChildFromStage functions that I've written here.[code]

View 3 Replies

Actionscript 3 :: Find All Instances In A CurrentFrame?

Sep 17, 2010

I have a movie with several imported videos which are instances of FLVPlayback. I want to make some Pause and Play buttons. Thus I need to know which video should I refer the stop() method to when I'm in a certain Frame. I believe it is something related to finding all existing instances in this.currentFrame and stopping the found instances.

View 1 Replies

ActionScript 3.0 :: Get CurrentFrame Value Of An MovieClip Without Using OnEnterFrame?

Jan 23, 2009

Is there a good way to get currentFrame value of an MovieClip without using onEnterFrame?

View 9 Replies

ActionScript 3.0 :: CurrentFrame Not Tracking Correctly

Dec 15, 2009

[code]...

My problem is that the currentFrame given always happens to be the first frame of the flash, because I have the code starting on the first frame, even though the code is throughout the flash.

How can I modify this code so that on click, it actually gets the currentFrame rather than the first?

View 2 Replies

ActionScript 3.0 :: Use CurrentFrame And Tweener.addTween?

Oct 31, 2010

I would like to use currentFrame... so if it hits frame 1 i should delay 3 sec and tween to frame 10 and again delayed 3 sec and go on to frame 20 etc.... like this code:

ActionScript Code:
if (mc_selected_bg.currentFrame == 1){
Tweener.addTween(MovieClip(mc_selected_bg),{_frame:10, time:0.6, delay:3.0})

[code]....

View 2 Replies

ActionScript 3.0 :: Tracking CurrentFrame And Storing It?

Apr 28, 2011

I want a set of 2 buttons. One button would be a nextBtn, that would mover the user forward one frame, and the other would be a homeBtn that would take them back to frame one.What I want to do is track what frame they are on (say frame 5) so that if they click the homeBtn and go back to frame 1, they could later click the nextBtn and now instead of going to the nextFrame they would go back to whatever frame they were on (which was 5). Here is was I was working on but I don't know how to store the frame the user left on.

PHP Code:

nextBtn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame);
function fl_ClickToGoToNextFrame(event:MouseEvent):void
{
var frame:Number;

[code].....

View 2 Replies

ActionScript 2.0 :: Understanding The Currentframe Concept

May 19, 2005

so I'm still learning the basic concepts. Attached to a movieclip used as a button I have this actionscript:

[Code]...

Which basically causes the movieclips 'leaf1' to shrink, 'vinefade' to go to its first frame, 'artween_mc' to unload, and for all other commands on this button to be disabled. I also want it to check another movieclip called 'leaf9', and see if it's current frame is at less than a particular frame number (73), because if so I want it to start playing forward. Once it reaches this frame number (73), I want to cause linkstween_mc to become visible and hit9button (also a movieclip) to become enabled. My current script does absolutely nothing to leaf9

View 6 Replies

ActionScript 2.0 :: Use A Movie Clip's Currentframe And Play It On Another?

Jul 4, 2010

I would like to have a control for the music to switch between each other in their current playtime. For example, let's say the 1st song movie clip is song1, the 2nd song movie clip is song2, when song1 is in frame 200, the control works in such that when i activate it, song2 will play in frame 200. I have made the control that switch from song1 to song2 in this way [code]...

View 2 Replies







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