Flash template customization help with links

I have a flash template and am trying to add links.  It has a main template and othre swf files that open up within the main (to the right) when clicked from a link on the main template.  The action on the links that work look like this:

on (rollOver) {
      _root.position = _parent.b5._y;
      gotoAndPlay("s1");
}
on (rollOut) {
      gotoAndPlay("s2");
}
on (release) {
      _root.link = "shop";
      _root.man.gotoAndPlay("s1");
}


The "shop" is the filename of a swf file "shop.swf"  The shop file opens in the right side when clicked from the main menu.  Plem is, I want to add links within the secondary flash movies like shop.swf  I may want to add a link to contact us or about us without having to click on the main menu link.  When I use the following nothing happens:

}
on (release) {
      _root.link = "aboutus";
}

It only seems to work on the main menu with all that other code in the action.
I am not too savvy with my flash programming so if someone could lend a hand??  Thanks.
LVL 3
Insomniac_PhDAsked:
Who is Participating?
 
blue-genieCommented:
Okay, here's what i'd do.

first of all, the bottom line of the problem is simply levels.

but instead of the code you have now in the man movieclip to load the next movies, rather take that out, and create a function in main.fla on the timeline as such.

_level0.link; //declare the variable
function loader() {
      loadMovieNum(link+".swf", 1);
}
then , in the man movieclip, replace with _root.loader(); //frame 55

then, what you want it to be able to swap out the swfs when you're in one of the swfs, so for example, lets say we have about.swf currently loaded, and you include a btn in there that's to return to home, you simply need this code on that button.
home_btn.onRelease = function() {
      _level0.link = "home";
      _level0.loader();
};

so, quite simply, the function that handles the navigation is on _level0, and all the swfs are loaded on _level1, so to access the function, simply refer to the function on _level0.

makes sense?
shout if you want me to upload the files.

blu.
(ps. you might want to think about using the sound object to handle your sound instead of dumping it directly on the timeline.)




0
 
techE_or_not_techECommented:
I am assuming that you are loading the external swf's into one of two places:  A different _level or a different movieClip.

In the first case, you may have to target the _root via levels (_level0)

If you are loading into another movieClip, then you may need to target the _parent timeline, not the root.  For example, in your loaded .swf, on the button script you may want to try:

on(release){
  this._parent._parent.link = "aboutus";
}

... or some similar combination [depending on your scene hierarchy].

Hope that helps!
0
 
Insomniac_PhDAuthor Commented:
No that didn't do it.  I try adding and taking away .parent also, but nothing.  The target is itself, not the parent.  When I click the button, it should replac the current clip with the about us clip.

Seems like it would be

this.link = "aboutus";
or
_this.link = "aboutus";

Does that seem right?  It does not work so I thought I better ask someone before my brain goes above 106  :)
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
techE_or_not_techECommented:
Are these .swf files in separate frames within the HTML of the document or are you loading 'aboutus' into a movieClip that acts as a container on the main timeline?  It also sounds like you might be trying to replace the entire movieClip/.swf file with a totally different one -- it this is the case, remember that unloading the main timeline [i.e. - loadMovieClip into level 0] will also unload your actions too.  That is, you might be calling the actions correctly, but there are no actions on the target timeline to be called.

if you could clarify a little, I think I could provide some better advice.
0
 
Insomniac_PhDAuthor Commented:
It is loading in a movie clip that acts as a container.  The container is main.swf.  It has buttons on it that work fine.  The actions on it look like:

}
on (release) {
     _root.link = "shop";
     _root.man.gotoAndPlay("s1");
}

With this, it loads shop.swf onto the screen.
0
 
techE_or_not_techECommented:
Maybe this will help:
http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_21089625.html

This scenario sounds very similar to yours.  It sounds to me like you are just getting your timelines and levels mixed up.  If youare attaching a script directly to a button, and you want to target other movie clips and actions that exist on the SAME timeline as the button, you must prefix your call to the action with _parent.  Otherwise, it is like calling the actions on the button itself.
0
 
blue-genieCommented:
if you still haven't resolved this, what code in on the main timeline?

or alternatively, post the file somewhere, i suspect the problems has something to do with pathing, but you're simply parsing a value to a variable by saying _root.link = "aboutus"; it needs to do something with that.

blu.
0
 
Insomniac_PhDAuthor Commented:

If you do take a look at it, you open main.swf which is the container I guess.  

On home.swf (fla) If anyone could get one of those 4 image hotspots at the bottom to link to about.swf, it would get me started!!!  :)

That's what I am trying to accomplish...just one link so I will know how to do it.

http://216.7.186.216/ee/flash.zip
0
 
blue-genieCommented:
none of your links on the left are doing anything.
0
 
blue-genieCommented:
help me out here, on your shop btn, you have the following code:

on (release) {
      _root.link = "shop";
      _root.man.gotoAndPlay("s1");
}

what is man supposed to be? i've looked in the explorer and I can't find it.

blu.
0
 
Insomniac_PhDAuthor Commented:
hmmm.   oh...if you go to the bootom and to the left a bit, you will see a big black square with 'man' on it.
0
 
Insomniac_PhDAuthor Commented:
The links on the left seem to work fine.  I think it's because I only zipped 3 parts.  I didn't send the other files. Do you need them?
0
 
blue-genieCommented:
*shaking head violently* - not on this version.
0
 
Insomniac_PhDAuthor Commented:
0
 
Insomniac_PhDAuthor Commented:
Could you?  I'll open a new question for additional points too.  You have gone above and beyond...

FTP Username:   bluegenie  
FTP Server IP:   216.7.186. 93  
Password:     passw0rd    ( that's a number zero)
FTP Folder:     \wwwroot\ee
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.