Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mikebatho

macrumors 6502a
Original poster
Jun 1, 2004
807
2
Greater Manchester UK
Bear with me, because I don't know Flash.

Afriend of mind is constructing a flash website for my artwork, and he's come across something he can't figure out.

I have a number of galleries of my work, all self contained on one page. However one page needs to be slipt into two.

There's the first page of buttons, each revealing a piece of artwork, the at the bottom is a button (word?) saying "more" which needs to go to the next page of stuff in that gallery (its the only gallery that spills over into two pages).

His problem lies with the fact that the "more" button is already placed within one flash movie, and he needs it to do a route source link to the second page of stuff..

How does he do that?

I actually said I'd wait til tomorrow before I'd post this, so he could tell me exactly what he needed to know, and if I haven't made this very clear, I'll have to post more, but watching him trying to sort this problem out, I kind thought I could see what he wanted to do....

Sorry if this sounds dumb, but I have never used Flash, and he's using a newer version that he's not as expert with....

Thanks.
 

clayj

macrumors 604
Jan 14, 2005
7,627
1,262
visiting from downstream
Here's how I've done it on my site, which has almost exactly the same setup you're talking about (two pages of glass, two pages of paintings, etc.).

The key is to use variables to determine the destination page when a particular button is clicked. For example, you might have ten buttons on a Flash page, all of which are supposed to load a different page. What you do is have each button have the following metacode (i.e., this ain't real code, it's English):

1. Set <destpage> variable to <appropriatevalue>.
2. Tell this page to go to its Unload routine (what it does prior to unloading).

In the Unload routine, the VERY last command should be a LoadMovie command that loads the movie whose name is stored in <destpage>, into the same level that THIS page was in. By doing this, you can have one page replace another, without disrupting pages at lower levels... and, you can have as many buttons as you want, each with a different destination page, but only ONE routine that actually has to load a movie (the Unload routine).

Does that make sense?
 

iBlue

macrumors Core
Mar 17, 2005
19,180
15
London, England
looks like clayj got you a good answer. i wish i knew more about flash, i couldn't assist much further :eek:

however in the future i think this topic might be better suited and recognized in the design/graphics room or perhaps Applications :confused: just a thought. :)
 

mikebatho

macrumors 6502a
Original poster
Jun 1, 2004
807
2
Greater Manchester UK
I'm sure that will make sense to him. It's a mystery to me!!!

Can you copy & paste the relevant bit of flash code onto here?

The old version of Flash he was using had a guide thingy you could refer to as you go, but this newer version in Windows (don't ask) seems to be lacking....

Thanks for the help..
 

clayj

macrumors 604
Jan 14, 2005
7,627
1,262
visiting from downstream
mikebatho said:
Nope.

He doesn't understand any of that, and doesn't know how to use variables. Unless it's a different way of phrasing it that you're using...?
OK, here are a couple of code snippets from one of my files:

CODE FOR THE BUTTON
on (press) {
movietoload = "BrowsePaintings2.swf";
gotoAndPlay("StartFadeOut");
}

("movietoload" is the variable that I use to determine what movie will be loaded when this movie unloads, and "StartFadeOut" is the frame that marks the beginning of my unloading sequence, i.e., the transition to the next movie.)

CODE IN VERY LAST FRAME OF MOVIE
loadMovieNum(movietoload, 4);
stop();

(In this case, the movie that I want to load, whose value is stored in the variable "movietoload", should be loaded into level 4, which is the same level in which THIS movie is loaded. By loading a new movie into the same level, I am replacing THIS movie with the new movie. "StartFadeOut" leads up to this code.)

Does that help?
 

rozwell

macrumors regular
Apr 17, 2004
242
1
from what i understand, hes loading the gallery as an external swf and the button is in that swf, not the main swf meaning that he is having some path issues. so if this is the case i will try to explain it below.

so say he loads the gallery.swf into the movieclip "holder". gallery.swf takes the instance name of the movieclip you load it into. so if the button in gallery.swf has an instance name of "more_btn" its path would be _root.holder.more_btn if it was on the top level of the gallery.swf movie.

say the next page of gallery.swf is on a frame labeled "page_02", in order to get to that frame after clicking the "more_btn" you would do:

_root.holder.more_btn.onPress = function(){
_root.holder.gotoAndPlay("page_02");
}

if this isnt the issue, then its there for anyone who may need it and if you are still having issues, uploading the .fla for us to check out would be good too.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.