dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Problem with relative paths in AS3

Hybrid View

  1. #1
    The Doctor Gonzo
    Join Date
    Feb 2003
    Location
    Misiones - Argentina
    Posts
    71

    Problem with relative paths in AS3

    Hi guys, I have a really weird problem.
    Im working in an application that when load takes from the browser data using Javascript and the ExternalInterface class...
    a code like this...

    Code:
    var posicioninicial:String = ExternalInterface.call('Selected');
    the main SWF is located in the root directory, and I need to load some SWF's from a different location, so i created this function:

    Code:
    		public function cargarPieza(codPza)
    		{
    			entrada:Loader = new Loader();
    			var peticion:URLRequest = new URLRequest("client/unidad/swf/" + codPza + ".swf");
    			entrada.contentLoaderInfo.addEventListener(Event.COMPLETE, cargaCompletaPieza);
    			entrada.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, cargaProgresoPieza);
    			entrada.load(peticion);
    		}
    And when the event is complete...

    Code:
    		public function cargaCompletaPieza(event:Event)
    		{
    			addChild(event.target.content);
    entrada.contentLoaderInfo.removeEventListener(Event.COMPLETE, cargaCompletaPieza);
    entrada.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, cargaProgresoPieza);
    		}
    The problem is that the swf file doesnt load at all, but when I put the SWF to load in the same directory and I use "nameofswf.swf" simple path... the movie loads... I dont know if Im using OK the path for the URL request or what's going on here.

    I can say in addition that Im working in a local environment (XAMPP server, APACHE, PHP, MySQL...) because I need to run the content in a local server to make work the ExternalInterface class correctly.

    It's pretty weird cause I dont really know where the problem is...
    Any ideas or suggestions could be realllllly appreciated!
    need a light?

  2. #2
    The Doctor Gonzo
    Join Date
    Feb 2003
    Location
    Misiones - Argentina
    Posts
    71
    hey guys any suggestions?

    Ive been trying some ideas and I realized that I need to publish to ACCESS NETWORK ONLY in the Local Playback security settings... and I can load the first level SWF (the first child) that is located in a different folder. But still couldn't load the children of it...
    Maybe it is a kind of Security Issue what Im facing here...
    any ideas?
    need a light?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center