Skip navigation
ngourlie
Currently Being Moderated

Further External SWF Issues

Mar 28, 2012 7:28 PM

Tags: #help #swf #load #actionscript_3.0 #external_swf #unload #flash_site

So once again, I am trying to create seperate external SWFs for my site in order to drastically reduce load times and each SWF loads a different section of my portfolio. This code worked for the first external SWF:

 

-----------------------------

var myLoader:Loader = new Loader();

var url:URLRequest = new URLRequest("flashfiles/bwphoto.swf");

myLoader.load(url);

bwanchor.addChild(myLoader);

 

-----------------------------

 

But now on a different area in the timeline when I try to use it on a different movie clip with a different SWF and URL, it doesn't work. It gives me two errors:

1151: A conflict exists with definition myLoader in namespace internal

1151: A conflict exists with definition url in namespace internal

 

What do these mean? And does someone maybe just have a better code to unload and load multiple external SWFs? Keep in mind it can be just click to load, click again to unload because each SWF has its own navigation to change the image shown.

 

Thanks again for any help.

 
Replies
  • Currently Being Moderated
    Mar 28, 2012 7:40 PM   in reply to ngourlie

    The errors seem to indicate that you are trying to declare the same variables again, namely 'myLoader' and 'url'.

     

    var myLoader:Loader = new Loader();

    var url:URLRequest ...

     

    When you use "var" you are declaring a variable.

     

    You cannot declare a variable more than once in a file.  So either use new variable names, or do not use the "var" declaration for any other times you use those variables in the file.  LAter in the timeline you could try using...

     

    myLoader = new Loader();

    url = new URLRequest("flashfiles/someother.swf");

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 29, 2012 4:35 AM   in reply to ngourlie

    I'd have to see what you did for the code to try to unravel the error messages.

     

    As far as creating new variables, you just do.. that... instead of using "myLoader" and "url", you use new words...

     

    var myOtherLoader:Loader = new Loader();

    var anotherUrl:URLRequest = new URLRequest("flashfiles/bwphoto.swf");

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 29, 2012 12:30 PM   in reply to ngourlie

    You're welcome

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points