ActionScript Help

Hi,

I’m creating a presentation in flash. I’m using the onmouse event command to move from frame to frame. But now I encountered a problem. This is how I have the menu button setup

Main Scene
-Main Menu 1 ( Movie Clip )
-Menu 1 ( Movie Clip )
-Button ( link to new frame in Main Scene )

There are no tweens used, because I’ve heard that you can’t use tweens when you want the buttons to link to other parts of the scene. It works good, but only works in the editing area. The actionScript I’m using is as follows for that button.

on (release) {
gotoAndStop(“Main Scene”, 12);
}

Could somebody please help. I would appreciate all the help you can provide. I’m attaching the file so that you can see What I mean.

Thank you,

The easiest and tidiest way to jump to certain frames is to use frame labels. Instead of

[COLOR=blue]on (release) {
gotoAndStop(“Main Scene”, 12);
}[/COLOR]

Click on frame 12, in the frame properties, enter a name for the label, eg. “thispoint”.

Then use for the action script:

[COLOR=blue]on (release) {
gotoAndStop(“thispoint”);
}[/COLOR]

If you can, post your fla.

I’m not sure also, as to what you mean by you’ve heard you can’t use tweens if you want to link the other parts of the scene.

Also make sure the frame you want to goto is not inside a movie clip, if so the action script would have to point to that movie clip.

i’ve attached the .fla to the original post,

That is what a friend of mines told me, but I’m not sure if that is possible or not.

if you can give me your email address and i can email it to you.

thank you for your help.

Check your private messages for my email address.

I’ve emailed you your fla - with modifications.

I’m looking at it right now, i was reading the actionscript for the menu items, can I use the same script for the other menu items, and place something like this:

on (release) {
_root.gotoAndStop(“cbombeable”);
}

I would just apply a label and add that action to the next menu item… right ?

I really appreciate your help, really i do

Thank you,

tweening… you can do that… it’s just a very tricky process.

Yes, on the frame labels layer, add a label and on the button use the action

[COLOR=blue]on (release){
_root.gotoAndPlay(“framelabel”);
}[/COLOR]

and it should go to that frame.

Cheers Dave but I prefer posting code in blue.

I’m doing it right now, I’ve added already a couple of them, but It ends up going to the same concreto normal description, im gonna try something different this time and see what happens. Ill try what you just told me now

thanks,

Make sure on the new frame label, eg. say you want to put a frame label called “thiscompany” on frame 17, you click on the correct frame in the correct layer (frame labels) and press F7 to insert a blank keyframe, then type the label. Otherwise the frame you’re on inherits from the last keyframe.

There are no tweens used, because I’ve heard that you can’t use tweens when you want the buttons to link to other parts of the scene.

The problem with this obviously is that if you’re in the middle of a tween, it will look strange if you seek a new section of a scene and the tween is not fluidly constructed between where the play head is, and where it’s jumping too.

The three ways that I use to avoid that problem are:

  1. use actionscript on movieclips to move them around. Most a/s movements can be done with an onClipEvent(){} and therefore never need more than one frame to exist in at a particular time. This is my preference, but if you’re still wet behind the ears, you’ll want to avoid this until you know a little about moving objects with a/s.
  2. make sure, if you have an action which sends the play head to another frame, that the frame has every element, in the exact same locations, as the frame you’re coming from. Usually this is accomplished with ‘Copy/Paste Frames’ options. This is the easiest way to solve the problem, but it adds file size to the movie.
  3. use movie clips with tweens inside them, and have the buttons, in addition to sending the playhead of the main timeline somewhere, also start, or stop or gotoAndPlay the movie clips that need to animate.

oh ok, i was getting that already, let me remove the frames…and re do it,

thanks,

Let me know how it works out.

It’s working !! yes yes yes !! thank you…

But I still have to get the tweening in there so I can have some movement on them. Im test that out once I’m done with this part. Thank you so much,

regards,

I still have your fla that I modified. Let me know what you wanted to do with the tweening.

how did you do the tweening for the concreto normal link ? , Also Can I add a tween in between the 1st page of the menu and the 2nd page of the menu, like a fade in and fade out something like that… ?? I think I could do it without affecting the rest of the scene…

As your movie is now, it’s harder to modify. You should try to seperate objects as much as you can by placing them in movie clips. This way you can change individual objects without changing the structure of the overall movie.

Let me have a quick look at the fla…

Actually I’m surprised how some of this fit’s together! You should try and reorganise some stuff, before it’s gets so that it’s too difficult to reorganise.