PDA

View Full Version : redirect to another flash/html


crab68
02-02-2009, 09:26 AM
I am not sure if this is possible, but let me paint the scenario here:

I have a html (main.html) calling flash. Within the flash ('main.swf') I have buttons for users choose from. Is it possible to have the new flash ('option1.swf') to replace 'main.swf' within 'main.html'. Or do I need to have Flash 'option1' embedded in another html ('option1.html).

If it is possible to replace 'main.swf' with 'option.swf' within 'main.html', how do i do it?

The other problem is when I call 'option1.html', it open the link as a new tab/window. How do i refreshed the current tab with the new html instead of opening the html link in a new tab?

memoorthy
02-02-2009, 09:50 AM
You have two ways to achieve your need.

Option 1
Yes, you can replace the main.swf with with option1.swf when you use
loadMovie('option1.swf', 0);
in your main.swf, where you want to load the option1 movie.
Check this tutorial on using levels in flash (http://www.webdesign.org/web/flash-&-swish/flash-tutorials/load-movies-into-levels-and-movie-clips.5993.html)

Option 2
You can also create a option1.html with option1.swf embedded in it. To avoid the new browser window problem you have to mention the target window to be _self, like
getURL('option1.html', '_self');



Good luck :)
Link to my blog (http://thegreenstudios.com)

crab68
02-05-2009, 04:54 AM
I tried your command but it gives me error. If i were to use the following comands, how do you translate that:

function callxyz(evt:Event):void{
navigateToURL (new URLRequest:"option1.html"));
}

atomic
02-05-2009, 04:57 AM
He posted AS2.0 code, and you're looking for AS3.0 code...

crab68
02-05-2009, 05:13 AM
oopss.. didn't know its different version. sorry for my ignorance. btw was is the equivalent of the codes in AS3.0?

thks.

atomic
02-05-2009, 05:24 AM
Sorry, but I'm not quite into AS3.0 yet... If ever! ;)