PDA

View Full Version : URLRequest Question



jjdelv
March 6th, 2009, 08:23 AM
Hi guys,

I have a quick question regarding URLRequests...
As you can see from the code below, I am currently on 'page 1.html' and when I click on 'homeBtn' I get taken to 'Charlotte Kay Jarvis.html'.

My question is: Can I be more specific about where the URL Request takes me? Not only would I like to be taken to 'Charlotte Kay Jarvis.html', but I would like to be on frame 2 of that page...


Thanks so much!








homeBtn.addEventListener(MouseEvent.CLICK, home);
var home_req:URLRequest = new URLRequest("Charlotte Kay Jarvis.html");

function home(event:MouseEvent):void{
navigateToURL(home_req, "_self");
}

Dom_
March 6th, 2009, 08:34 AM
on frame 2 of the swf movie in the html page ?

jjdelv
March 6th, 2009, 11:46 AM
Indeed...
Please tell me it is possible!


on frame 2 of the swf movie in the html page ?

snickelfritz
March 6th, 2009, 12:54 PM
Place a stop() action on frame2 of the timeline of the SWF file on the HTML page in question.
ie: the SWF file will begin to play when the page is loaded, and stop on frame2.
The playhead in a SWF file is always "playing" until instructed otherwise.

jjdelv
March 6th, 2009, 01:58 PM
Cheers Snickelfritz, but that doesnt work for me. The 'Home' page is on frame 1, the 'about' page is on frame 2 and the 'contact' page is on frame three of the swf at the moment. Currently I have no problem linking my way back to 'home', but what do I do to link it back to 'contact' or 'about'?

MuiAA
March 6th, 2009, 02:59 PM
So you have a SWF with all your controlling buttons (like homBtn), that you wish to control the current frame of another SWF housing all the sections (home, about, contact) correct?

If so, see if you can use the LocalConnection class to pass variable strings of "home", "about", and "contact" to your SWF with the section labels. I've only done this successfully offline, so I'm unsure of the complications when uploading on the web, be wary.