0

i've been looking for long time a way to setup swfaddress with flash as3, assuming that the content is pulling from an xml. Basicaly, i got an xml that contain reference of SWF i load in my main.swf

What i already can do :

Each time a swf has been loaded - the html page title change via setTitle() - the url change via setValue();

What i cannot do : - changing the url on the browser does not load the wanted swf

Has my content is totaly dynamic, i cannot use the swich / case method.

Please can somebody help me?

user367864
  • 283
  • 2
  • 5
  • 11

1 Answers1

0

Are you sure you have the JavaScript included on your host page? Remember that you must listen for the SWFAddressEvents before you listen for any user events at all.

citizen conn
  • 15,300
  • 3
  • 58
  • 80
  • Hello, everything works great in a static way, i mean for exemple the above code works SWFAddress.addEventListener(SWFAddressEvent.CHANGE, addressChange); function addressChange(event:Event) { switch (SWFAddress.getValue()) { case '/Test1': // Do the thing i want to do break; }} – user367864 Jun 17 '11 at 17:46
  • You dont HAVE to use a switch() case. You can simply call an action with the value of the event. For example: new ViewObject(event.getValue()){ and then render the value to the screen. – citizen conn Jun 17 '11 at 17:54
  • Sorry i don't understand the method. – user367864 Jun 17 '11 at 18:00
  • all Im saying is you dont have to use a switch case, you can still use the value of the event. – citizen conn Jun 17 '11 at 18:07
  • I know but impossible to make it work. What i've tryed is search for an entry in my array that match SWFAddress.getValue().split("/").join(" ")... but it doesn't do nothing. – user367864 Jun 17 '11 at 18:13
  • better than getValue().split("/").join(" ") would be getValue().substr(1); which will return everything after the slash. Im currently using that. – citizen conn Jun 17 '11 at 18:30
  • ok thanks for the tip. Do you have a code exemple i can study using SWFAddress with xml content? – user367864 Jun 17 '11 at 18:38
  • Not one that I can pass along, sorry. – citizen conn Jun 17 '11 at 18:48