3 posts
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 1 and 100 dollars
  • United Kingdom
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);

1675 posts Envato Elite Author
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Author had a Free File of the Month
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
+1 more
Tean says

What doesnt work in your code exactly?

Do you get any errors?

5 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Russian Federation
  • Sold between 100 and 1 000 dollars
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