-
onEnterFrame?
Hi there,
Im trying to make this thing - that when this keyframe is arrived at, that the film has two options depending on whether a global variable is true or not. If that variable is true, it stops() at that keyframe. If it isnt true, it goes to and plays ("printos"). Only I dont have a clue of the correct syntax - my best bet would be the one below, but it doesnt work. What would be the correct way to write this please?
function.OnEnterFrame();
if(_global.printer == false){
gotoAndPlay("printos")
{
if(_global.printer == true){
stop();
}
}
Last edited by jopeiro; 04-27-2006 at 06:48 PM.
-
function onEnterFrame() {
}
or onEnterFrame = function() {
}
both work.
-
hi, first off thanks for the reply.
second, neither seem to work...i wonder where i messed up. Doesnt seem to gotoandplay "printos" when the variable is set to true
function onEnterFrame() {
if (_global.printer == true) {
gotoAndPlay("printos");
} else {
stop();
}
};
just stops at that frame i wrote it into in both cases..would you happen to know a way beyond this?
-
Flashkit Veteran
-
Flashmatics
Must be some error is setting your variable..put a trace statement in and see what value you get for _global.printer.
(Also if its a global variable you dont really need to put the _global in front to see what it's value is. Otherwise it kind of defeats the object of defining it as a global!!)
anyway that aside:
Code:
function onEnterFrame() {
trace(_global.printer);
if (_global.printer == true) {
gotoAndPlay("printos");
} else {
stop();
}
};
-
Hey thank you all!
this.onEnterFrame();
if (_global.printer == true) {
_root.multipass.gotoAndPlay("printos");
}
if (_global.printer == false) {
stop();
}
did it for me
-
I was going to say put quotes around true, but apparently you didnt have to.
when you set a variable to either true or false, and then you check the variable to find the value, I always need to put it in quotes or it doesn't work
code:
var soundPlay = true;
if (soundPlay == "true"){
do whatever
};
if I don't put the quotes it appears it is trying to compare to the value of true, and not true itself.
who knows
IMS
-
actually, pretend I never posted in here, I have values in an xml that are true or false which then would need the quotes in the comparison because they come in as strings...
i'm ready for this day to be over
IMS
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
|