Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2005-05-09
5
Medium Priority
?
213 Views
Last Modified: 2010-05-19
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
0
Comment
Question by:MarkOs
  • 3
  • 2
5 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 13957533
what code are you using to go to the links?
0
 
LVL 1

Author Comment

by:MarkOs
ID: 13957561
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
 
LVL 39

Accepted Solution

by:
blue-genie earned 1000 total points
ID: 13957638
:-)

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

Author Comment

by:MarkOs
ID: 13964169
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
 
LVL 39

Expert Comment

by:blue-genie
ID: 13975531
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
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 this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses
Course of the Month15 days, 1 hour left to enroll

578 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