dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Another Loader Class Issue. Help!

  1. #1
    Junior Member
    Join Date
    Sep 2006
    Location
    Flower City, Indonesia
    Posts
    11

    Question Another Loader Class Issue. Help!

    i have this problem.

    "page.swf" is nice working SWF file that load list.xml & picture.jpg. I stored those files on folder data.

    I create another SWF called "index.swf" and i stored it outside folder data. When i try to load "page.swf" locally using Loader Class from "index.swf", the compiler errors said "can't load list.xml & picture.jpg". Because index.swf searched in it's directory not in folder data.

    Can you help me to solve this problem without changing the "page.fla"?is it security policy problem?


  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    It's probably not a security problem, but the fact that it's simply looking in the wrong directory. Without seeing the code that page.swf uses to load those files I can't say for certain why.

    You may be able to resolve it by setting the "base" parameter in the final embed code which loads index.swf. This sets the directory to be used as the base for local urls. You can set it to the data folder.

  3. #3
    Junior Member
    Join Date
    Sep 2006
    Location
    Flower City, Indonesia
    Posts
    11
    Quote Originally Posted by 5TonsOfFlax View Post
    It's probably not a security problem, but the fact that it's simply looking in the wrong directory. Without seeing the code that page.swf uses to load those files I can't say for certain why.

    You may be able to resolve it by setting the "base" parameter in the final embed code which loads index.swf. This sets the directory to be used as the base for local urls. You can set it to the data folder.
    Can you give me a sample code?
    this is my standart code in index.fla

    Code:
    import flash.display.Loader;
    
    var ldr:Loader = new Loader();
    var urlReq:URLRequest = new URLRequest("data/page.swf");
    ldr.load(urlReq);
    addChild(ldr);
    Can i solve this issue with Flex?anyone?

    thx b4 5TonsOfFlax

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    If you use the base parameter, you'd replace "data/page.swf" with "page.swf". The base parameter is set on the object/embed code in the html page. See this:
    http://kb2.adobe.com/cps/127/tn_12701.html

    SwfObject also supports this parameter. http://code.google.com/p/swfobject/wiki/documentation

  5. #5
    Junior Member
    Join Date
    Sep 2006
    Location
    Flower City, Indonesia
    Posts
    11
    Yeah you right, the base parameter is the solutions for this problem, but i'm not planning to create this SWF for the web, i'm planning to create a standalone projector.

    any other sugestions?

    thanks in advance

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