Dynamically Create Loader?

  • duncanhall
  • Born
  • Born
  • duncanhall
  • Posts: 1

Post 3+ Months Ago

Does anyone know how I can dynamically create an 'mx controls loader' object via actionscript?

Ive been trying with this:

Code: [ Select ]
_root.mx.controls.Loader.createObject


but dont seem to be getting any luck. The above asks for the following parameters:

(linkageName, id, depth, initObj)

Any help would be most appreciated.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

Adding Components to the Stage Using ActionScript
for FlashMX i couldnt make it work using the EndPoint class, so i removed it from the code below. Also make sure you have in the library the component that you want to dynamicaly create. (drag it to the stage, then delete it from the stage -> it will remain in the library)
Code: [ Select ]
import mx.data.binding.*;
this.createClassObject(mx.controls.ComboBox, "my_cb", 1, {_x:10, _y:10});
this.createClassObject(mx.controls.Label, "my_lbl", 2, {_x:10, _y:40});
this.createClassObject(mx.controls.Label, "my_lbl1", 3, {_x:10, _y:60});
my_cb.addItem("JAN", 0);
my_cb.addItem("FEB", 1);
my_cb.addItem("MAR", 2);
my_cb.addItem("APR", 3);
my_cb.addItem("MAY", 4);
my_cb.addItem("JUN", 5);

my_lbl.text = "Jan";
my_lbl2.text = "Feb";
stop();
  1. import mx.data.binding.*;
  2. this.createClassObject(mx.controls.ComboBox, "my_cb", 1, {_x:10, _y:10});
  3. this.createClassObject(mx.controls.Label, "my_lbl", 2, {_x:10, _y:40});
  4. this.createClassObject(mx.controls.Label, "my_lbl1", 3, {_x:10, _y:60});
  5. my_cb.addItem("JAN", 0);
  6. my_cb.addItem("FEB", 1);
  7. my_cb.addItem("MAR", 2);
  8. my_cb.addItem("APR", 3);
  9. my_cb.addItem("MAY", 4);
  10. my_cb.addItem("JUN", 5);
  11. my_lbl.text = "Jan";
  12. my_lbl2.text = "Feb";
  13. stop();

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 9 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.