Flash Components

  • saintcools
  • Born
  • Born
  • No Avatar
  • Joined: Nov 03, 2006
  • Posts: 1
  • Status: Offline

Post November 3rd, 2006, 11:37 pm

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

Regards
Saintcools
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 3rd, 2006, 11:37 pm

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post November 5th, 2006, 1:37 pm

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
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post November 6th, 2006, 2:22 am

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.
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”

Post Information

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

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.