Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-04-2001, 08:34 PM   #1
Michelsen
Registered User
 
Join Date: May 2001
Location: Little Axe, OK
Posts: 3
Send a message via Yahoo to Michelsen
Question

I'm new to Flash programming and have started to work on a company business card project for educational purposes. The problem I'm having is coming up with a clean way to bring up arbitrary movies clips from a menu.

Is there an accepted way of doing this? Things I've tinkered with are:

(1) Movie clips on specific frames with each frame having a stop action to hold the playing to that clip and a button sending it to that frame. This seemed messy but it worked unless you hit a button to send you to a specific frame and you were already there.

(2) Movie clips are initially invisible and they are all stacked on top of each other in the same frames. Buttons turn the specific movie visible and turn all the previously visible ones off. I haven't tried this method yet, but I'm not convinced this is clean either, and I haven't figured out how to initially set all the movies to invisible (i.e. actionscript on first frame or some neat initial properties option I haven't found yet).

I have valiantly searched for a good example, and I haven't found one with out so much overhead in it that I had to get the aspirin bottle out.

Any help would be greatly appreciated. I'm really interested in what the "average bear" is doing.

Erik Michelsen
Michelsen is offline   Reply With Quote
Old 05-05-2001, 10:29 AM   #2
Jesse
ActionScript.org Founder
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: New York
Posts: 8,736
Default

I would use option 2, it's clean.
Give your graphics (movie clips) instance names which are sequential, like "graphic1", "graphic2", etc.

Then use a loop and a function. So on the first frame of you movie have this function:

function hideThem (button) {
for (x=1; x<5; x++) {
if (x != button) {
_root["graphic"+x]._visible = false;
} else {
_root["graphic"+x]._visible = true;
}
}
}
hideThem()

This function takes one argument; the number of the graphic you want to display, and hides all graphics but that one. Given no argument it hides all graphics so on the first frame you run it with no arguments:

_root.hideThem()

This will make all your graphics invisible. Then make your buttons have code like this:

on (release) {
hideThem(Z);
}

Where 'Z' is a number indicating which graphic you wish to show. All other graphics will be hidden

Cheers

Jesse
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 05-08-2001, 02:48 PM   #3
Michelsen
Registered User
 
Join Date: May 2001
Location: Little Axe, OK
Posts: 3
Send a message via Yahoo to Michelsen
Unhappy

Thanks Jesse.

I have to admit, I'm still having problems. It sounds so easy when you explain it, but I can't seem to get it to work. I have put the function on frame 1, but it doesn't hide the movie clips (mc1 and mc2). If you are interested, you can download the fla at http://asip.tinker.af.mil/for-testing/emichel/Demo.fla and see my broken stuff yourself I'm pulling my hair out.

Best wishes.

Erik
Michelsen is offline   Reply With Quote
Old 05-08-2001, 03:55 PM   #4
Michelsen
Registered User
 
Join Date: May 2001
Location: Little Axe, OK
Posts: 3
Send a message via Yahoo to Michelsen
Default

Ah, okay, I figured it out. Lesson learned... instance name is not equal to movie clip name.

Erik
Michelsen is offline   Reply With Quote
Old 05-09-2001, 05:00 AM   #5
Jesse
ActionScript.org Founder
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: New York
Posts: 8,736
Default

hehe

There's a tutorial on instance if you need more info

Cheers

Jesse
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic link inside of dynamic menu Natcon67 ActionScript 1.0 (and below) 3 01-24-2005 01:45 AM
DHTML/Javascript Dropdown menu problems section8ight Other Flash General Questions 1 06-23-2004 06:01 PM
movie clip as drop-down menu Juicer ActionScript 1.0 (and below) 2 09-01-2003 12:35 AM
Dropdown Menu Problems holdaway ActionScript 1.0 (and below) 2 02-14-2003 06:27 AM


All times are GMT. The time now is 12:00 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.