Solved

Flash template customization help with links

Posted on 2004-08-20
15
162 Views
Last Modified: 2010-04-03
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.
0
Comment
Question by:Insomniac_PhD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
  • 3
15 Comments
 
LVL 1

Expert Comment

by:techE_or_not_techE
ID: 11858647
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
 
LVL 3

Author Comment

by:Insomniac_PhD
ID: 11867262
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
 
LVL 1

Expert Comment

by:techE_or_not_techE
ID: 11869153
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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 3

Author Comment

by:Insomniac_PhD
ID: 11869186
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
 
LVL 1

Expert Comment

by:techE_or_not_techE
ID: 11869298
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
 
LVL 39

Expert Comment

by:blue-genie
ID: 11901207
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
 
LVL 3

Author Comment

by:Insomniac_PhD
ID: 11901925

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
 
LVL 39

Expert Comment

by:blue-genie
ID: 11902118
none of your links on the left are doing anything.
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 11902200
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
 
LVL 3

Author Comment

by:Insomniac_PhD
ID: 11902917
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
 
LVL 3

Author Comment

by:Insomniac_PhD
ID: 11902936
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
 
LVL 39

Expert Comment

by:blue-genie
ID: 11902956
*shaking head violently* - not on this version.
0
 
LVL 3

Author Comment

by:Insomniac_PhD
ID: 11903358
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
ID: 11910687
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
 
LVL 3

Author Comment

by:Insomniac_PhD
ID: 11911688
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question