HOW TO CHANGE BROWSER URL FROM SWF (AS3)

  • sitevalidate03
  • Novice
  • Novice
  • No Avatar
  • Joined: May 01, 2009
  • Posts: 18
  • Status: Offline

Post June 18th, 2009, 9:28 am

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 18th, 2009, 9:28 am

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post June 18th, 2009, 2:45 pm

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");
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com
  • sitevalidate03
  • Novice
  • Novice
  • No Avatar
  • Joined: May 01, 2009
  • Posts: 18
  • Status: Offline

Post June 18th, 2009, 3:13 pm

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
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post June 18th, 2009, 3:15 pm

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.
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com
  • sitevalidate03
  • Novice
  • Novice
  • No Avatar
  • Joined: May 01, 2009
  • Posts: 18
  • Status: Offline

Post June 18th, 2009, 4:45 pm

thanks again !
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post June 19th, 2009, 9:34 am

Your welcome.
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com
  • sitevalidate03
  • Novice
  • Novice
  • No Avatar
  • Joined: May 01, 2009
  • Posts: 18
  • Status: Offline

Post June 19th, 2009, 9:32 pm

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
  • No Avatar
  • Joined: May 01, 2009
  • Posts: 18
  • Status: Offline

Post June 19th, 2009, 9:39 pm

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 35 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.