3 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 50+ items on Envato Market
+2 more
Nadia-1 says

Hi there,

From last few days i’m playing with a AS 3 .0 code which is a bit a headache for me to load swf movies in as 3.0. I created an interactive cd in as 2.0 but now I had to convert in as 3.0 and i can’t load.

here is the code, if somebody can help me. I will be very thankful.

var Xpos:Number = 0;
var Ypos:Number = 0;
var loader:Loader = new Loader();

var defaultSWF:URLRequest = new URLRequest("fscommand/index.swf");

loader.load(defaultSWF);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);

// Btns fucntions
function info_btn(event:MouseEvent):void {

removeChild(loader);
var newSWFRequest:URLRequest = new URLRequest("fscommand/information.swf");
loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);

}

function welcome_btn(event:MouseEvent):void {

removeChild(loader);
var newSWFRequest:URLRequest = new URLRequest("fscommand/welcome.swf");
loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);

}

// Btn listeners
welcome_btn.addEventListener(MouseEvent.CLICK, welcome_btn);
info_btn.addEventListener(MouseEvent.CLICK, info_btn);

1677 posts Envato Elite Author
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
Tean says

What doesnt work in your code exactly?

Do you get any errors?

5 posts
  • Has been part of the Envato Community for over 2 years
  • Has sold $100+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
feelgood66 says

I do not think this solves the problem, but some suggestions: before each load not only remove the boot loader screen, and scrub the memory. And then create a new one.

in first var loader:Loader

where you need to make to load:

if (loader != null) { loader.removeListener … // if you added listeners (strange that they are not); removeChild(loader); loader = null;

} after that: loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_complete); loader.load(new URLREquest…)

on load is function loader_complete(e:Event):void { addChild(loader) }

p.s. If You need – i can to see your sourses and to find error

by
by
by
by
by
by