Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loader action script help needed !

Status
Not open for further replies.

patch999

Technical User
May 27, 2007
1
GB
hi there .
I've setup a flash movie with a very simple loader and a set of buttons which on rollover set the content path of the loader. This is done using actionscript attached to the buttons.

on(rollOver) {
portfolio_loader.contentPath = "Page_00.jpg";
}

very simple !

Anyways I now want a button which functions as an "enlarge view" button. I need some script which will do a getURL depending on the currently loaded image in the loader.

So i.e. when contentPath = "Page_00.jpg" then getURL("Page_00_Large.jpg")

But i would need it to be able to do that with up to 30 different variables. Any help will be most welcome.

Thanks in advance.

Patch
 
You can create the String "Page_00_Large.jpg" from "Page_00.jpg" dynamically:

trace(portfolio_loader.contentPath.split(".")[0]+"_Large.jpg");

So you won't need to write 30 different scripts - you can do it with just one script.

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top