3 posts
  • Has been part of the Envato Community for over 6 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);

1680 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 3 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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by