Clicking a link twice causes the flash player to jump to the next frame.

Hi,

I have built a flash program for a products parts list.
The program has the product split into it's key assemblies and displays zoomable 3D line drawings of each assembly so that each area can be zoomed and then individual parts click on to view their information.

I have a problem where a link is clicked, which causes the movie to jump to a certain frame, but if the same link is clicked again, it jumps to the next frame, even though it is already on the desired one.

I am looking for the best solution to solve this as it is a regular occurance to have the same part listed twice on the scree, ie: two bolts the same or something.
This means that if the user clicks one of the bolts, it goes to, say, frame 6, then they click the other bolt to check if it is the same, it goes to frame 7 which is the description frame of the nut.
The program also has litteraly hundreds, maybe even thousands of links in it already so i am trying to find a solution that will mean we don't have to change every single link already created.

It may also be important to know that the program is CD based using the projector file, rather than embedded in an HTML document. This has meant the use of any dynamic or server side content has been prohibited, however we have used mostly external txt and swf files to compile everything meaning updates are easy and possible future HDD installations should be easily managed and updateable.

Any help would be greatly appreciated.

Cheers,

Mark
LVL 1
MarkOsAsked:
Who is Participating?
 
blue-genieCommented:
:-)

apart from the frame problem, is this loading of the txt file working properly?

reason I'm asking, I'd say it's bad form to have all this on a onRelease on the clip/btn itself.

also, u're setting qty.html to true, then setting the text of _parent.qty.htmText = "" - why? Surely it should be without the _parent in all instance or with (depending on your file setup)

is the stuff that's being loaded going into the content on frame 12?

i was able to recreate the error, here's the easiest suggestion.

simply change your code to gotoAndStop(12) ...

also, i'd suggest you remove your loadVars bits of code onto the frame, that way you won't be loading stuff unnecessary (though its run on CD you won't have issues with bandwidth).

blu
0
 
blue-genieCommented:
what code are you using to go to the links?
0
 
MarkOsAuthor Commented:
Damn, should have known you were going to ask that straight away!!!

Here is an example:
---------------------------------------------------------------

on (release) {
      gotoAndPlay(12);
loadText = new LoadVars();
loadText.load("text/7/7-11.txt");
loadText.onLoad = function() {
                  desc.html = true;
                  _parent.desc.htmlText = this.desc;
                  number.html = true;
                  _parent.number.htmlText = this.number;
                  qty.html = true;
                  _parent.qty.htmlText = this.qty;
                  desc2.html = true;
                  _parent.desc2.htmlText = this.desc2;
                  number2.html = true;
                  _parent.number2.htmlText = this.number2;
                  qty2.html = true;
                  _parent.qty2.htmlText = this.qty2;
};
      }

-----------------------------------------------------------------------------

With the gotoAndPlay command, frame 12 will have a stop() command on it so that the player stops.

Mark
0
 
MarkOsAuthor Commented:
Haha, yes, the text file loading does work - miraculously!!
This side of it was coded by someone else as I am not much of an actionscripter and i see your point - it does look a bit odd - however, due to the work it would create, i think i'll apply the "if it aint broke, don't fix it rule"  :o)

Anyway, i had a sneaking suspision that gotoAndStop would be the key but hadn't realised it until i wrote all this!
Either way, it's a mammoth task to change each one manually.
Do you know if there is any kind of search and replace function for all actionscript in an FLA? Keeping in mind it would need to be a viewable thing so that we can only change the ones that need changing?

Thanks very much for your help so far too.

Cheers,

Mark
0
 
blue-genieCommented:
what version of flash are u using, in flash mx 2004 pro, use the find and replace option in the edit menu. > specify current document. Don't see anything in flash MX.

for future reference, for these exact reasons, advisable to use generic methods and call them, thus only need to make changes in one place :-)

good luck.
blu.
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.