PDA

View Full Version : Havin probs with this code , any help?


Respy
08-04-2003, 08:41 AM
okies guys its really simple i want a move ti play certain frames according to a variable called 'complete' heres the code i got ...
onClipEvent (load) {
if (complete>=60) {
_root.locked2.gotoAndPlay(1);
} else {
_root.locked2.gotoAndPlay(2);
}
}

its just not working at all thought , any tips or anything would be greatly appreciated -Respy

JHallam
08-04-2003, 09:31 AM
explain some more, where you setting the var and how you setting the argument?

silvernapalm
08-04-2003, 09:33 AM
the code looks okay but have you tried onEnterFrame versus load.

load usually initializes variables. onEnterFrame gives the mc power.
if problem persists upload the files

Respy
08-04-2003, 09:47 AM
ok ive tried it on enter of the frame , not working.. im declaring the variable on the main timeline frame of which 'locked2' appears... the code however is within the MC (locked2)...anymore ideas?
your beign great so far thx guys - Respy

smoke10010
08-04-2003, 11:41 PM
if the code is within the instance of lock2 then it sounds like a pathing problem.. as well you might need to keep it on enterFrame since on load it will only check that condition once.. (on load)
if the variable "complete" is on the main timeline and the code is within lock2 the variable "complete" will not be found unless you path it to the main timeline... using either of these should work.

this._parent.complete >=60;
_root.complete >=60;


of course the enterframe depends on what you are after if you only want the condition to be checked once on load then keep it on load. Also you might consider making your code more relative as it helps if you import or move things around.
instead of
_root.lock2.gotoAndPlay(1);

try using
this.gotoAndPlay(1);

Respy
08-05-2003, 07:38 AM
thanks a whole bunch ive got my unlocking part of my game completely finished now thanks alot :) - Respy