Solved

Flash template customization help with links

Posted on 2004-08-20
15
157 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
  • 7
  • 5
  • 3
15 Comments
 
LVL 1

Expert Comment

by:techE_or_not_techE
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 3

Author Comment

by:Insomniac_PhD
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 39

Expert Comment

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

Expert Comment

by:blue-genie
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
*shaking head violently* - not on this version.
0
 
LVL 3

Author Comment

by:Insomniac_PhD
Comment Utility
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now