Solved

button diirect to different page on website.

Posted on 2010-11-21
8
325 Views
Last Modified: 2012-06-21
I have a flash that works pretty good except the "read more' button should direct to  a different page depending on what is selected.

if you open the swf file you will see that if you click the read more button it works correctly, but once you select the nose,throat, etc. that the read more doesn't work anymore. It should send you to the correct page depending on what item you are reading.


Source code can be downloaded from here:            www.techprotest.com/slideshow1.fla
slideshow1.swf
0
Comment
Question by:techpr0
  • 4
  • 3
8 Comments
 
LVL 5

Expert Comment

by:gingermoleman
ID: 34185143
Hi,

Your source files zip is corrupted but the code your after is generally as shown:

//this should exist at the same point (in the timeline) as the button
var url:String = "http://www.yourpage.com";
var request:URLRequest = new URLRequest(url);
navigateToURL(request, '_blank');

//This line to be repeated whenever you change to another category
url = "http://www.yournewpage.com";

Hope this helps

GMM
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 34194069
if  you haven't come right, please save your file for CS4 and we'll have a look.
0
 

Author Comment

by:techpr0
ID: 34223549
Sorry for the delayed response. I have saved the file as cs4. I also tested the solutionby gingermoleman with no luck. If you run this file and immediately click "read more" it works right, but if you rollover any of the buttons prior it does not.

Source code can be downloaded from here:            www.techprotest.com/slideshowTest.fla
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 5

Accepted Solution

by:
gingermoleman earned 500 total points
ID: 34223571
Hi,
okay, this is in as2, which im not overly familiar but well give it a crack!

You say its working for Ears right?
well you need to change this function

images_mc.my11_btn.onRelease = function(){
getURL("ear.aspx", "_self");
}

to something like
var myUrl = "ears.aspx";
images_mc.my11_btn.onRelease = function(){
getURL(myUrl, "_self");
}
 then in all you onRelease code eg
images_mc.my44_btn.onRelease = function(){
getURL("neck.aspx", "_self");
}

this should be

images_mc.my44_btn.onRelease = function(){
myUrl="neck.aspx";
}


GMM
0
 

Author Comment

by:techpr0
ID: 34223590
I changed it per your response to the following with no luck. the read more button doesn't do anything.
menu_mc.my1_btn.onRollOver = function(){
images_mc.gotoAndStop(1);
}

var myUrl = "ears.aspx";
images_mc.my11_btn.onRelease = function(){
getURL(myUrl, "_self");
}

menu_mc.my2_btn.onRollOver = function(){
images_mc.gotoAndStop(2);
}

images_mc.my22_btn.onRelease = function(){
myUrl="nose.aspx";
}

menu_mc.my3_btn.onRollOver = function(){
images_mc.gotoAndStop(3);
}

images_mc.my33_btn.onRelease = function(){
myUrl="throat.aspx";
}

menu_mc.my4_btn.onRollOver = function(){
images_mc.gotoAndStop(4);
}

images_mc.my44_btn.onRelease = function(){
myUrl="neck.aspx";
}

menu_mc.my5_btn.onRollOver = function(){
images_mc.gotoAndStop(5);
}
images_mc.my55_btn.onRelease = function(){
myUrl="allergy.aspx";

}

Open in new window

0
 
LVL 5

Assisted Solution

by:gingermoleman
gingermoleman earned 500 total points
ID: 34223635
my bad, found your issue.
You said your code worked for the 1st selection right but not the others?
this is because you do actually have 1 button per zone not one button overall.
these are my11_btn, my22_btn, my33_btn, etc

so, basically take your one working click

images_mc.my11_btn.onRelease = function(){
getURL("ear.aspx", "_self");
}

and duplicate it to
images_mc.my22_btn.onRelease = function(){
getURL("nose.aspx", "_self");
}
 etc

GMM
0
 

Author Closing Comment

by:techpr0
ID: 34223992
I tried this with no luck, but I noticed where you said you thought I had one button overall so I made it one button and used your previous solution to get it to work. Thanks.
0
 
LVL 5

Expert Comment

by:gingermoleman
ID: 34225273
excellent, glad it helped!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
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…
The viewer will learn how to dynamically set the form action using jQuery.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

770 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