PDA

View Full Version : tell target _root


mikkeX
02-20-2002, 05:31 PM
I can not figure out what i asm doing wrong, i want to go to antoher scene by clicking a button inside a movieclip, i tried using this code:

on (release) {
tellTarget ("_root") {
gotoAndPlay ("Facts1", 1);
}
}

But it does not work - what happens is that the movie just start from the beginning, what am i missing here?

/mikke

Bernie X
02-20-2002, 06:02 PM
on (release) {
tellTarget ("_root") {
gotoAndPlay ("Facts1", 1);
}
}


DO NOT USE SCENES...keep everything on one main timeline

mikkeX
02-20-2002, 06:31 PM
No, i do not want to target a movieclip - i just want to change scene.



Let me rewrite...

on (release) {
tellTarget ("_root") {
gotoAndPlay ("Scene 2", 1);
}
}

Bernie X
02-20-2002, 06:34 PM
Originally posted by mikkeX
No, i do not want to target a movieclip - i just want to change scene.

Let me rewrite...

on (release) {
tellTarget ("_root") {
gotoAndPlay ("Scene 2", 1);
}
}


Sorry to mislead you like that; here's the scoop...


don't use more than one scene in your fla...have one main timeline - this will kill A LOT of frustration.

mikkeX
02-20-2002, 09:18 PM
I solved the problem - not so very smothe, but...

I did it this way:

On my button in the movieclip I used:

on (press) {
tellTarget ("_root") {
gotoAndPlay ("goto");
}
}


I called the label goto on the scene (the label is placed after a stop) and on that frame I just used:


gotoAndPlay ("Facts1", 1);


If anyone have an better solution, please post it.

Why use scenes? In this case I am working with Flash to do a cd-rom production - and I have to be able to move the scenes around.

I think it is much easier to use scenes when working on a large scale production.

Thanks fo the answers anyway.

/mikke

Bernie X
02-20-2002, 09:44 PM
Hey you actually answered some on the questions that I had w/ my code. Thx for the tip. I take back that don't use scenes advise - do what works for you.

Bernie X

Sckz
02-21-2002, 10:40 PM
Hi MikkeX!

Frankly, I don't see why you use 'target' if you mean the main timeline. Can't you just write:

on (realease) {
gotoAndPlay("scene1", 1);
}

That should work. Bernie X is also right. In Flash, the scene system is only that it is clear for you. Like a file&folders system. In fact Flash makes 1 big scene by pasting your scenes together. If you want it to keep simple I would recommend to have 1 scene with frame labels. Let's say, your first 'scene' takes 70 frames. Give frame 1 the label "start". For the next 'scene' go to frame 100 and make a keyframe (F6). There you give the frame a label "Second Scene" and you place your content. The next will start on frame 300.

This is still clear and easy to find without scene trouble, referring to BernieX.

Personally I would prefer to make a kind of browser that shows your 'scenes' as loaded .swf files. Every scene you design you can export as a .swf. That you load into your 'browser' with loadMovie.

This takes some more manual reading that provides more advanced ActionScripting but it makes it also possible to make your CD-production ready for internet. You only have to change the different parts.

I hope all this makes sense.

Grtz,

Sckz

mikkeX
02-22-2002, 10:53 AM
on (realease) {
gotoAndPlay("scene1", 1);
}

No, you can not target scenes like that from a mc.

I have attached a file to explain the solution, and you could try it yourself...

Why this problem with scenes, like I explained before - if you work on a big project, like a cd-rom, and you and your cosutmer do not really know if the order of things is final when you start to work, it is much, much easier, to use scenes.

Ok, sometimes there are problems like my question in the beginning - but, why not solve the problems instead of just say that scenes are no good?

I have done some work under a couple of years in flash, and I really could not understand why I should not use scenes if I like to work with Flash that way.

Anyway, test the file, and you see...

:confused:

Sckz
02-22-2002, 11:52 AM
Hi there,

I opened your example and I see the problem. I also tried the object trick but didn't work:

_parent.gotoAndStop("Scene 2", 1);

So this is one of the troubles with scenes. Good that you don't experience problems with scenes. And you're right: problems are there to be solved.
But it can be that you'll find a problem you can't solve. Then there are many scenes to change. Lot of work. And in the solution you made it will be a lot of work anyway to change the order.

I would never build a project using this way, but everyone has his own technique. Using external files is a lot saver, faster and easier to track your files.

Good luck,

Sckz