PDA

View Full Version : buttons and links


Lugosi
07-23-2004, 09:40 PM
I am using Flash MX 2004. I have recently inherited the maintenance of a website that was designed in Flash MX.

I have a main timeline which has multiple frames which are labelled. One of the frames is called performance. Within the performance frame I have opened another timeline on which I add two performance charts. Each chart is on it own frame which are labelled argon and air. The argon chart is the first chart that displays when a user clicks a link to that page.

I have added a button on the argon page to connect to the air chart. This button has the following action:

on (release) {
gotoAndStop ("air");
}

When tested the above button doesn't work.

I have also tried using the frame number (frame 11) as opposed to the frame label and I seem to be getting the frame 11 on the main timeline, not the 'sub' timeline. I think this issue has to do with paths but I haven't been able to pinpoint the problem. How do I make sure that the code is 'looking' at the right timeline (the current timeline) and not the root timeline?

I have created other buttons with working links but I'm not sure what I'm doing wrong this time. I have also created a test document and put a couple buttons on it with similar code and the buttons work...however I only had one timeline in my test.

Any help would be greatly appreciated.

Cheers
Lugosi

tg
07-23-2004, 10:06 PM
my guess is that your 'performance' timeline has a movieclip on it. on the movieclips timeline you have your 'argon' and 'air' frames.

is the button on the main timeline?

if so, goto the performance frame and see if the movieclip has an instance name. then from the button you would do:
on(release){
this.performanceMovieClipInstanceName.gotoAndStop( 'air');
}
kinda hard to visualize whats going on there.

Lugosi
07-23-2004, 10:22 PM
The button appears on the main timeline however to edit the actions for it you go to the sub timeline (I guess that's called the movieclip timeline, I'm still learning the terminology!). I've set up the chart images as movieclips and named them argonchart_mc and airchart_mc.

I tried

on (release) {
this.airchart_mc.gotoAndStop ('air');
}

and nothing happens. Is the 'performanceMovieClipInstanceName' supposed to be the name of the chart I want to link to or the name of the first chart on the page? Should I have left the charts as Graphics instead of movieclips?

Cheers
Lugosi

tg
07-23-2004, 11:35 PM
Is the 'performanceMovieClipInstanceName' supposed to be the name of the chart I want to link to or the name of the first chart on the page? Should I have left the charts as Graphics instead of movieclips?

Cheers
Lugosi
should be the name of the movieclip that contains the frames 'air' and 'argon'

tg
07-23-2004, 11:36 PM
you might want to take a look at the tutorial section. look at the path tutorial in the beginners section. it contains alot of good info that is pertinent to your situation.