Can not get the use of variable function!

Hi, I created an actionscript function that stops at an animation to a specific image that works very well. Then, I loaded in a php file with a variable that will contain the number for the frame I want to stop on the animation. It loaded fine and I loaded it into a function. what I can't do is enter the variable in the function that tells the animation to stop playing.

Here is my code:

load variables
varReceiver = new LoadVars(); create an object to store the variables
varReceiver.load ("http://playground.nsdesign6.net/percentage/external.php" "");
load variables

function1
varReceiver.onLoad = function() {}
value is the var that is created.
var paul = this.percentage;
}
function1

function2
this.onEnterFrame = function() {}
{if (this._currentframe == (Paul))}
This.Stop ();
this.onEnterFrame = undefined;
}
}
Play();
function2

One problem lies in that you declare the variable in a function.  This limits the scope of this variable to the function. So that your enterFrame function can not see it.  Another thing you should consider is not the enterFrame function until the variable is read.  So while I would have suggested that you move the declaration of the variables of the function, maybe move the enterFrame function will have a similar effect...

varReceiver.onLoad = function() {}
value is the var that is created.
var paul = this.percentage;

this.onEnterFrame = function() {}
{if (this._currentframe == (Paul))}
This.Stop ();
this.onEnterFrame = undefined;
}
}

}
   
Play();

If this does not work, then just try to move the variable outside the function declaration and only assign its value it contains.  In this way, paul is visible in the second function...

var paul;

function1
varReceiver.onLoad = function() {}
value is the var that is created.
Paul = this.percentage;
}
function1

Tags: Adobe Animate

Similar Questions

Maybe you are looking for

  • model reference control

    Hello I've just hava on thing in my mind Why is there nothing in the control of labview block 2012 that implement the model reference adaptive control? any information! ~~ Best regards m, sm

  • RandomGen elements, case structure nothing if it's false, while the loop passes iterations, can not get the values in table outside the structure of the case

    Hello! I tried to build a trigger that triggers a true value each 1000 milliseconds (from the first real); which real command structure box to a value of the randomNrGen of the sample and place it in a table. but I would like to USE this table and I

  • Scanning for convert to text - recognition of words in bold problems

    I have an Office Pro 8500 running on Windows XP. During the analysis of text (rtf), sometimes the scanner will recognize the words in characters bold and on other occasions, he won't. When it does not show the "BOLD" type, it shows everything in norm

  • scam you think?

    I just received a telephone call from a girl called Janet who said she was calling from Windows and every time I logged on my computer all my personal stuff has been compromised. She also wanted me to turn on my computer while she was on the phone an

  • Re activation SSID

    I was able to disable my SSID in the advance settings, I try now to allow it, but now get the message, the settings have been changed and I have to use the username admin with my current password to access my settings and when I do, it bounces me in