-
[RESOLVED] AS2 pathing...
I have found some code that uses _root.
//_root.createTextField("timer", _root.getNextHighestDepth(), 5, 0, 100, 25);
_root.myMinutes = 10; //set to number of starting minutes
_root.mySeconds = 0; //set to number of starting seconds
_root.myMilliseconds = 0 //set to number of starting milliseconds
_root.timer.text = "000:00:" + twoDigitString(myMinutes) + ":" + twoDigitString(mySeconds) + ":" + myMilliseconds;
function updateTimer() {
if(_root.myMilliseconds == 0) {
if(_root.mySeconds == 0) {
if(_root.myMinutes == 0) {
_root.timer.text = "Please continue!";
clearInterval(myInterval);
delete myInterval;
}
else {
_root.myMinutes = _root.myMinutes - 1;
_root.mySeconds = 59;
_root.timer.text = "000:00:" + twoDigitString(myMinutes) + ":" + twoDigitString(mySeconds) + ":" + myMilliseconds;
}
}
else {
_root.mySeconds = _root.mySeconds - 1;
_root.myMilliseconds = 400;
_root.timer.text = "000:00:" + twoDigitString(myMinutes) + ":" + twoDigitString(mySeconds) + ":" + myMilliseconds;
}
}
else {
_root.myMilliseconds = _root.myMilliseconds - 1;
_root.timer.text = "000:00:" + twoDigitString(myMinutes) + ":" + twoDigitString(mySeconds) + ":" + myMilliseconds;
}
}
// This function will make sure we have two number places in our number if it's less then 9(0#)
function twoDigitString(myNumber) {
myTemp = String(myNumber);
if(myTemp.length == 1) {
myTemp = "0" + myTemp;
}
return myTemp;
}
myInterval = setInterval(updateTimer, 1);
stop();
but I am using the swf in a container so the _root. breaks this Im sure...
I have tried changing all the _root. to this. with no luck it doesnt work at all?!?!?!
Please help
Red
-
If you are publishing for the Flash 7 or later player, try adding the following as the first line in your above code.
Code:
this._lockroot = true;
Or on the first frame of the main timeline.
Last edited by dawsonk; 08-31-2010 at 04:01 PM.
Reason: Added more...
-
Senior Member
I believe it goes in the external.swf being loaded..
-
Great that worked! but now the dynamic text field bumps around as its counting down. It is fine when I view the swf by itself.
-
Senior Member
what does 'bumps around' mean?
-
It moves about 5-10 pixels left then right and then sometimes up and down?!?!?! about 1-2 time a second.
-
Can you post stripped down versions of your flas here?
-
I should explain a bit more - It only bounces around in the Articulate wrapper.
-
I embedded the numbers and it seemed to work - thanks everyone for the help!
-
Senior Member
is your text field on WHOLE NUMBER X/Y values?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|