PDA

View Full Version : Variables within a frame?


coolsiteworkerb
04-14-2003, 05:32 AM
Ok, I have one scene, what will happen is you click a movie clip it goes to frame 8; then after the animation is finished from frame 8 - 22; it determines where to go by a variable placed into the 1st frame?

So in frame one I have in a movieclip button:
on (press)
{
_root.gotoAndPlay (8);
_root.set (wheretogo, Thatone);


}
(It does go to 8 - 22 but then does not stop and moves through the rest of the frames!) (I also tried using numbers, now attempted using frame names)

In 23 (a keyframe so animation will finish and then move on to this frame..) I put a variable just in the frame itself:
_root.gotoAndStop("wheretogo"); (I also tried just gotoAndStop)

It doesnt do this at all.. It doesnt go to the frame assigned to the variable location instead it just plays through all of the scenes.

bluegel
04-14-2003, 08:38 AM
stupid comment, but have you put a stop on frame 23, and then the code that you want to do?

coolsiteworkerb
04-14-2003, 02:39 PM
I tried it with the stop, without the stop, with it 1st with it last in every possible combination I can think of.

maxx
04-15-2003, 12:38 AM
Just an idea - probably not a good one, either (I'm tired now) - try changing this line of code_root.gotoAndStop("wheretogo"); to this:_root.gotoAndStop([wheretogo]); Not sure if it'll take care of your problem, but here's my logic (ha) - If it's in the quotes, won't Flash look for a frame labeled (literally) what's in the quotes? So the use of the square brackets lets Flash know that it's a variable, not a literal string. Right? Am I making any sense at all?

coolsiteworkerb
04-15-2003, 12:53 AM
Ok.. I tried that, no luck

However something strange is when I imported my stuff into the file that the other person uploaded it works ok.. soooo I dont know what is wrong with my code.. if anyone knows let me know cause I cant find the error!!

bluegel
04-15-2003, 08:53 AM
can you upload a sample file?

coolsiteworkerb
04-15-2003, 04:25 PM
I posted a zip with 2 of them that I treid to add movement above.. Ill post again.