Flash Components

  • saintcools
  • Born
  • Born
  • saintcools
  • Posts: 1

Post 3+ Months Ago

Hi
Could anyone tell me the functions and syntax of using the components in flash with actionscript.

Regards
Saintcools
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Each component that comes with Flash has its own commands, as do components that you get from elsewhere. If your trying to use components that come with flash open up the Flash Help and search for the component name
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

example: add a label and a combo box on the stage then delete them (will remain in the library). then:
Code: [ Select ]
objComboListener = new Object();
objComboListener.change = function(eventObj){
  my_lbl.text = eventObj.target.text;
 trace(my_lbl.text);
}


this.createClassObject(mx.controls.ComboBox, "my_cb", 1, {_x:10, _y:10});
this.createClassObject(mx.controls.Label, "my_lbl", 2, {_x:10, _y:40});

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_cb.addEventListener("change", objComboListener);
stop();
  1. objComboListener = new Object();
  2. objComboListener.change = function(eventObj){
  3.   my_lbl.text = eventObj.target.text;
  4.  trace(my_lbl.text);
  5. }
  6. this.createClassObject(mx.controls.ComboBox, "my_cb", 1, {_x:10, _y:10});
  7. this.createClassObject(mx.controls.Label, "my_lbl", 2, {_x:10, _y:40});
  8. my_cb.addItem("JAN", 0);
  9. my_cb.addItem("FEB", 1);
  10. my_cb.addItem("MAR", 2);
  11. my_cb.addItem("APR", 3);
  12. my_cb.addItem("MAY", 4);
  13. my_cb.addItem("JUN", 5);
  14. my_lbl.text = "Jan";
  15. my_cb.addEventListener("change", objComboListener);
  16. stop();

This will create a combo box filled with Jan to Jun months, and on change, it will change the label text to the selected item.
The rest about em ... in flash help -> Using Components section.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 14 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.