Test The _root._currentframe Value In An "if" Statement?
May 5, 2009
I'm trying to test the _root._currentframe value in an "if" statement, but I want to test it using the frame LABEL, not the frame NUMBER.
For example:
on(release) {
if(_root._currentframe != "homePage") {
gotoAndPlay("home");
}
}
I know this works if I put the frame NUMBER instead of the label. But is there a way that I can get it to work with the LABEL?
View 1 Replies
Similar Posts:
Sep 9, 2010
I'm trying to test the _root._currentframe value in an "if" statement, but I want to test it using the frame LABEL, not the frame NUMBER.
For example:
on(release) {
if(_root._currentframe != "homePage") {
gotoAndPlay("home");
}
}
I know this works if I put the frame NUMBER instead of the label. But is there a way that I can get it to work with the LABEL?
View 2 Replies
Jul 15, 2005
I'm trying to test the _root._currentframe value in an "if" statement, but I want to test it using the frame LABEL, not the frame NUMBER.
[Code]...
I know this works if I put the frame NUMBER instead of the label. But is there a way that I can get it to work with the LABEL??
View 2 Replies
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
Nov 6, 2003
How can I test a undefined variablewith an if statement.
all a this did not work and I don't want to define a value for this variable.
name of the variable x.
if ((x == "") || (x == " ") (x == Nan))
{
trace("here");
}
Someone could find me the correct if statemtn to check an undefined variable on action script 1, mx 6..develloped with MX2004Pro.
View 1 Replies
Jul 6, 2010
If I have movieclips called "test1", "test2" and "test3" in the _root, I can use:
for(i = 1; i <= 3; i++){
_root['test'+i]._x = 100;
}
How do i use the "_root['mc']" selection method if all my test mc's are in another mc called layout.I have tried this but got a syntax error.
for(i = 1; i <= 3; i++){
layout.['test'+i]._x = 100;
}
View 1 Replies
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
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
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
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
Nov 10, 2009
I have this code
on(release){
_root.ohm_mc.gotoAndPlay(11);
if (_root.ohm_mc._currentframe == 25)
{
[code]....
I need movieclip to reach frame 25 and then jump to "organos de gobierno", but although it is stopped at frame 25, it does not do the jump to the other frame .... aAny idea why?? Please i need to fix this to finish a job. And in my previous times using this it always worked
View 4 Replies
Feb 5, 2007
I have a flash file, and in it is a movieclipbutton. When you roll over the button, the button has to grow in size and change color. This animation is 10 frames long. When you roll out, the button goes back to it's original size and color, this animation is also 10 frames. But when you roll out of the button before the 10 frames of roll over animation are finished, the movie jumps to the rollout animation, which starts with the button in grown size; so you see a little jump in size. To fix this, I did the following for the onRollOut:
Code:
this.btn_1.onRollOut = function() {
this.gotoAndPlay(45 - this._currentframe);
}
This however, doesn't work. When I put a trace(this._currentframe) inside, it returns 1. But this isn't right, it should return something between 10 and 20! I have the .fla file on the internet:[URL]
View 3 Replies
Apr 4, 2011
Working on a linear movie and I want to do dynamic page numbers, i.e. when on the page, display that you are on page "x" of "xtotal" I created a dynamic text box, and tried to set it equal to ._currentframe, but that didn't work. Is there a way to do this?
View 2 Replies
Nov 15, 2004
i have a menu with 4 buttons. If i rollover an button, it will play a movie clip (tooltip, about 5 seconds long). I know, how to do that. But the problem is, when i roll over another button, then i need to stop that movie clip to stop half way and play reverse.how about using _currentframe and if and else handlers?
View 6 Replies
Jun 12, 2006
I am trying to stop/pause my MC when I click on an image.
EG:
on (press){
gotoAndStop._currentframe;
getURL("image1.jpg", "_blank");
}
But when my image loads into the new window and I go back to the main content window on where I clicked the movie has already started playing!
[Code]...
View 4 Replies
Jan 9, 2009
My script have a list of .swf files and needs to play them one by one. My problem is that i can't detect when the movieclip (containing the swf) completes playing.
I understood that i need to copmare between _currentframe and _totalframes of the moviecip but i keep getting 1 as the _currentframe (my main timeline contains only 1 frame).
Code:
var mcLoader:MovieClipLoader = new MovieClipLoader();
var loadListener:Object = new Object();
var container:MovieClip =
[Code]....
View 4 Replies
Sep 17, 2011
I'm trying to test a custom Flex 4 skinnable component, using the FlexUnit UIImpersonator class. If I run my tests from a FlashBuilder Spark only project everything works fine. If I try to test from a project with the mx component set on the classpath I get a "getElementIndex not available in non Flex 4 projects" error.Can I unit test spark components in FlexUnits visual test environment while still having the mx component set on the classpath?
UIImpersonator delegates it's method calls to a "testEnvironment".The implementation used for this "testEnvironment" is decided by the VisualTest EnvironmentBuilder class and the FlexEnvironmentBuilder class. If the FlexEnvironmentBuilder class can find the "mx.core.Container" on the classpath it returns a MX environment, else a Spark environment. Only the spark environment has valid implementations for Flex 4 relevant method calls on the UIImpersonator - like the addElement method.
View 1 Replies
May 14, 2009
Having a few problems with what I thought was a simple if statement. Here is the code:
[Code]...
I can't quite figure out the small problem with the code. It seems to just bypass the first requirement of the if statement when I do type in the proper input and go straight to the else statement.
View 7 Replies
Aug 4, 2011
My buttons only work when I click on them on the stage while having the "enable simple buttons" option on. They do not work if I try to "test movie," "test scene" and publish it to a SWF. Nothing responds whenever I am in these modes. I am using Adobe Flash Professional CS5 Actionscript 2.0.
This is the code that I put in for the buttons:
[Code].....
View 5 Replies
Aug 30, 2009
i have a movie that has worked fine in past during Html test but ive been doing some dubugging using the flash test latly and it runs fine here but when i go back and try to test in Html mode no errors come just the movie never fully starts (starts up about as much as if there was an error).
View 5 Replies
Aug 31, 2011
if (variable == 1){
//code
//Execute this code.
} else if (variable == 2) {
//code
[Code]...
I dont want to copy the code from the first into the second and the first and second into the third.
My mind isn't working and there is probably an extremelly simple way to get this working.
I know I could used functions but for some reason it stops the instance referencing working: _root["bullet"+j] doesnt work in a function.
View 7 Replies
Oct 10, 2008
The Flash movie contains 2 Text files, one Component button, and 1 component checkbox.The purpose of the application is to load an XML file(works)Populate 2 text fields with information from the XML file(works)Compare the two text fields, if they contain the same information then the checkbox, via AS is told to be selected. (Heres the problem);
Heres the code:
Code:
runCode_btn.onPress = function() {
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = function(success) {
[code]....
The idea behind this app is that its an electronic form. The user fills it out, the information is then sent to a newly created XML file, months later the open the XML file in flash, and Flash fills out text fields and check and or unchecks Checkboxes based on the XML data.CheckBoxes are mandatory.But I don't see how I'll be able to use them if i can't create and condition statements based on the loaded Data.
View 1 Replies
Mar 19, 2009
I have two scenes in my flash file and in scene 1, first button takes you to frame 2 where movie clip is -works
on (release) {
gotoAndStop("scene1",2);
}
second button takes you to frame 3
but on scene 2 that performs same function as scene 1, the first button
on(press){
gotoAndStop("scene2",2);
}
instead of going to frame 2 goes to frame 3. and the second button goes correctly to frame 3.that happens when i test scene! when i test movie all buttons work properly.
View 1 Replies
Jan 21, 2010
In FlexUnit 1 it is possible to access the name of the currently-running test using the TestCase.getName() method because all tests subclass TestCase. In FlexUnit 4, however, there's no base class for tests; the tests are identified by annotations. So, how can I replicate the getName() functionality in FlexUnit 4?
View 2 Replies
Mar 30, 2011
why this code won't work
[Code]...
I'm sure you can put if statements inside other if statements, seriously I can't figure it out
View 4 Replies
Dec 2, 2009
I have this code
[CODE]...
I need ohm movieclip to reach frame 25 and then jump to "organos de gobierno", but although it is stopped at frame 25, it does not do the jump to the other frame.
View 2 Replies
Sep 22, 2010
I need to write an if statement inside an if-else statement. But no matter how I write it it keeps giving me a syntax error.The syntax error is "1083: syntax error: else is unexpected".[code]No matter how or where I place the braces, it keeps giving me errors.
View 13 Replies
Jul 12, 2010
what I'm trying to do is create an else if argument for each object in an array based on a user set number
Code:
for(var i:int=0; i < numberOfElseIfs; i++){
GENERATE AS3 CODE
}
to which I want it to GENERATE THE FOLLOWING CODE:
Code:
}else if(baskets[i].used == false){
baskets[i].used = true;
drawButton(i);
}
the problem is obviously that the compiler reads this code rather than understanding I'm trying to regenerate the code within the for loop...does that make sense :S? So basically I need as3 to read the code between the for statement as if it is going to echo that out later. Is this even possible?
View 4 Replies
Feb 22, 2012
Does any one have a idea about how to do a packet loss test like in ping test from flash technologies (Flash or Flex)?
View 1 Replies
Sep 22, 2010
I have a script which is giving me a lot of trouble since I have no idea how to write another "if statement" inside another if-else statement. I keep getting errors, I guess I don't know where to put the braces exactly...
example:
if(bla == bla) {
<------------how would I write another if statement here?
}else if (bla == bla){
}
View 3 Replies