HOW TO CHANGE BROWSER URL FROM SWF (AS3)

  • sitevalidate03
  • Novice
  • Novice
  • sitevalidate03
  • Posts: 18

Post 3+ Months Ago

Ok, I have a bit of an issue:

I have two swf's in different html files. I want both of them to load before playing the first one, and than at the end of the first swf file, I want it to be redirected to my second html file (containing the second swf)

can anyone help me with the code to redirect the browser urls..and does anyone know how i would go about loading both the swf's before playing the first one?

thanks in advance.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

well you CANNOT load both swfs unless they are on the same page since I'm not aware of any way to load another html file in the background... There are some browsers that can attempt to follow links and preload content but I've yet to see it work very well.

As for going to another page the actionscript code is
Code: [ Select ]
getURL("newpage.html");
  • sitevalidate03
  • Novice
  • Novice
  • sitevalidate03
  • Posts: 18

Post 3+ Months Ago

yeah im using AS3, so i cant use the getURL function, but actually i want to load 2 swfs..play one and then play the next one after it is done (even if it is in the same html)..do you know if this is possible?
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

I would make a container swf and then use AS to load both into that container so that its not dependent on the html page. That way you can do the preload as well by simply placing the second swf off the stage while the first one plays.
  • sitevalidate03
  • Novice
  • Novice
  • sitevalidate03
  • Posts: 18

Post 3+ Months Ago

thanks again !
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Your welcome.
  • sitevalidate03
  • Novice
  • Novice
  • sitevalidate03
  • Posts: 18

Post 3+ Months Ago

i do wanna know one thing... this is my code

Code: [ Select ]
b_btn.addEventListener(MouseEvent.CLICK, myButtonFunction);
function myButtonFunction(event: Event) {
    var request:URLRequest = new URLRequest("5.html");
    navigateToURL(request, "_self");
    trace("works");
}
  1. b_btn.addEventListener(MouseEvent.CLICK, myButtonFunction);
  2. function myButtonFunction(event: Event) {
  3.     var request:URLRequest = new URLRequest("5.html");
  4.     navigateToURL(request, "_self");
  5.     trace("works");
  6. }



when i export the swf through flash, i get the trace output and it opens my browser to open 5.html as desired..
but when i view the swf in its html file..it doesnt work? is there some kind of code i should include in the html?
  • sitevalidate03
  • Novice
  • Novice
  • sitevalidate03
  • Posts: 18

Post 3+ Months Ago

nevermind , for some reason it works on the server..and does not work with local files..

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 14 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.