Solved

button diirect to different page on website.

Posted on 2010-11-21
8
319 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

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

Join & Write a Comment

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…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
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.

759 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

20 Experts available now in Live!

Get 1:1 Help Now