Assigning Instance Names with ActionScript 3.0

Thu, Oct 22, 2009

ActionScript


There is no such a thing as a item on stage without an instance name. If you did not create a name, ActionScript 3.0 will create a name for you. Find out how to trace this name and how to access the item, using it.

CLICK HERE FOR A COMPLETE ACTIONSCRIPT 3.0 CARTOON SMART TUTORIAL

HERE IS THE SOURCE CODE!

//The ActionScript 3.0 Assign instance names on stage with ActionScript 3.0
// Avraham Saltoun solutions at say-web dot com
// FREE to USE, COPY and DISTRIBUTE

var mySmile : Smile;

// the variable mySmile will contain
// a smile movie clip

//This will add 3 smiles
//next one another

for (var i: int =0; i <3; i++) {
mySmile = new Smile();
//this class was automatically created
// on previous tutorial
addChild (mySmile);
//this adds a smile to stage

mySmile.x = i*mySmile.width;
//this will position the smile next to previous

// this will assign a name to our stage item....
mySmile.name = "mySmile"+i;
//i variable is the loop counter

//This will give us the instance name
trace (mySmile.name);
}

addChild(mySmile);
//this will place a smile
//on our empty stage

remove_btn.addEventListener(MouseEvent.CLICK, removeSmile);
// removeSmile is a function we will create
// that removes the movie clip from stage

function removeSmile (event:MouseEvent):void {

removeChild(getChildByName ("mySmile0"));

// this will remove the child with the name we created from stage.
}

// thanks for watching !!

Related Articles:

, , , , , , , , , , , , , , ,

1,807 Responses to “Assigning Instance Names with ActionScript 3.0”

  1. asrqhrqhkb Says:

    In rare instances, men [url=http://buycheapkamagraonline.com/]purchase kamagra[/url] buy kamagra brand fascinating PDE5 inhibitors (vocal [url=http://buycheapgenericviagraonline.com/]viagra pharmacy[/url] cheap viagra erectile dysfunction medicines, including VIAGRA) reported a [url=http://achatviagraenligne.fr/]viagra Bordeaux[/url] acheter viagra France astute wither or ruin of vision. It is not plausible to critic whether these events are coordinated straight to these medicines or to other factors. If you norm coherence precipitous lessen or succeeding of perspicacity, a break bewitching PDE5 inhibitors, including VIAGRA, and upon a doctor without hesitating away.

  2. wnwjiklfsd Says:

    In rare instances, men cheap kamagra kamagra pharmacy entrancing PDE5 inhibitors (vocal buy viagra generic viagra cheap erectile dysfunction medicines, including VIAGRA) reported a achat viagra Paris viagra Toulouse surprising contract or disappearance of vision. It is not doable to arbitrate whether these events are allied upfront to these medicines or to other factors. If you commemoration invigorated de-escalation or deprivation of project, distend up bewitching PDE5 inhibitors, including VIAGRA, and trumpet a doctor hole on away.

  3. buxgofsree Says:

    In rare instances, men kamagra order kamagra cheap buy captivating PDE5 inhibitors (enunciated buy viagra viagra buy cheap erectile dysfunction medicines, including VIAGRA) reported a achat viagra Lyon achat viagra Paris unthought of forestall or destitution of vision. It is not doable to evaluator whether these events are tied up when to these medicines or to other factors. If you involvement unceremonious disparage or impoverishment of pr‚cis, termination winsome PDE5 inhibitors, including VIAGRA, and blare a doctor without hesitating away.

  4. rpjfejixyp Says:

    In rare instances, men kamagra pills kamagra cheap captivating PDE5 inhibitors (word-of-mouth viagra buy cheap viagra pills erectile dysfunction medicines, including VIAGRA) reported a achat viagra Marseille achat viagra en ligne surprising atrophy or bereavement of vision. It is not accomplishable to select whether these events are coordinated fair-minded to these medicines or to other factors. If you involvement rude de-escalation or fault of screenplay, closing captivating PDE5 inhibitors, including VIAGRA, and nickname a doctor throw away.

  5. robbert Says:

    Hey very nice web site!! Man .. Beautiful .. Amazing .. I will bookmark your site and take the feeds also…I am happy to find numerous useful information here in the post, we need work out more techniques in this regard, thanks for sharing. . . . . .


Trackbacks/Pingbacks

  1. Hi…

    I really like your writing style, excellent info, thanks for posting :D . “I will show you fear in a handful of dust.” by T. S. Eliot….

  2. Hello…

    Some genuinely superb content on this website , thankyou for contribution….

  3. Hey…

    I like what you guys are up too. Such intelligent work and reporting! Keep up the excellent works guys I’ve incorporated you guys to my blogroll. I think it’ll improve the value of my site :) ….

  4. Hello…

    I like this blog so much, saved to my bookmarks ….

  5. Nice blog…

    I really love the design of this blog. Cheers!…

  6. Hi!…

    I like this weblog so significantly, saved to my bookmarks……

  7. Hi!…

    I adore this weblog so a lot, saved to my bookmarks!…

  8. Wnetrza says:

    Hi!…

    I love this website so significantly, saved to my bookmarks……

  9. Hello…

    I like this blog so much, saved to my bookmarks ….

  10. Hi…

    Enjoyed looking through this, very good stuff, thankyou . “If it was an overnight success, it was one long, hard, sleepless night.” by Dicky Barrett….

  11. URL says:

    … [Trackback]…

    [...] Read More Infos here: say-web.com/2009/10/22/assigning-instance-names-with-actionscript-3-0/ [...]…

  12. DJ Wroclaw says:

    Hello…

    I like this blog so significantly, saved to my bookmarks ….

  13. Hi…

    I like this post, enjoyed this one thanks for putting up. “Good communication is as stimulating as black coffee and just as hard to sleep after.” by Anne Morrow Lindbergh….

  14. relieved with medication so it shouldn’t be…

    a massive hurdle in your quest to have a baby. at one time, estrogen pills were promoted by pharmaceutical companies as the answer to menopausal symptoms. these estrogen raising drugs were supposed to provide numerous health benefits including a reduce…

  15. Hi…

    You are my aspiration, I own few blogs and sometimes run out from post :) . “The soul that is within me no man can degrade.” by Frederick Douglas….

  16. Yahoo results…

    While searching Yahoo I discovered this page in the results and I didn’t think it fit…

  17. cobham taxi says:

    Net minicab…

    Oxshott Taxi!…

  18. Hey…

    Simply a smiling visitant here to share the love (:, btw outstanding style and design. “He profits most who serves best.” by Arthur F. Sheldon….

  19. Hilley Caery says:

    You should check this out…

    [...] Wonderful story, reckoned we could combine a few unrelated data, nevertheless really worth taking a look, whoa did one learn about Mid East has got more problerms as well [...]……

  20. Adelk says:

    Informative and precise…

    Its difficult to find informative and accurate information but here I found…

  21. with a 10 step wide square and…

    then twice with a 14 step wide square.6. don’t try to emphasize passing yet, except by playing the dribble around cone & pass relay race game — tell your scorers to try to score and teach them to look for rebounds…

  22. Yahoo results…

    While searching Yahoo I found this page in the results and I didn’t think it fit…

  23. dives, it will still not dive deep…

    enough to tick the rocks. if you were to try this from the shoreline, however, you would find that as you brought the lures into shore and the water got shallower, you would end up snagging your lure.now that you are…

  24. Health says:

    Websites we think you should visit…

    [...]although websites we backlink to below are considerably not related to ours, we feel they are actually worth a go through, so have a look[...]……

  25. vigrx pill says:

    I do not agree but…

    [...]Well, I really don’t accept what you may have mentioned within the article, but I really do regard your perspective[...]……

  26. Source…

    If I remember corectly I found it here…

  27. Just read this ……

    Lovely just what I was searching for….

  28. red lobster says:

    behind. when they had finally designed one…

    & put it out there, there were a number of problems that came with it. when a car would travel at a high speed on the freeway, the steel-belted radials would show symptoms of separation of the tread; & if you…

  29. tire tread says:

    a study at the kaiser-permanente institute in…

    california found that massaging around the eyes (not applying any pressure to the eye itself!) and across the forehead helped dieters lose about one extra pound a month. old navy is owned by gap and makes great clothing for fashion minded…

  30. butter, and season. garnish your lobster tail…

    your way.boilingthis is the most common method. fill up a large skillet with water and add a teaspoon of salt. i sometimes add a teaspoon of apple cider vinegar; i like how it enhances taste in my seafood. bring to boil….

  31. tv owners are complaining about their tvs…

    turning off for no apparent reason. this is caused by a program glitch from the factory. a firmware update has been provided by samsung to correct this. this is just like the patches which are downloadable so that your computer can…

  32. Having problem with frontal hair loss?…

    Discover proven and effective frontal hair loss treatment that works now!…

  33. hydroponics growers may need to adjust water/nutrient…

    release rates, and soil growers should utilize a soil dampness meter to develop a proper watering schedule.veteran and commercial indoor growers may wish to record water and nutrient use and other environmental factors like temperature and ventilation …

  34. glass that is electronically converted into plasma…

    and emits ultraviolet light, stimulating phosphors to ultimately display light from the screen. this technology was revolutionary during its mass production in the late 1990s and sparked a huge popularity in plasma televisions that brought about its ma…

  35. the privilege to drive, your car insurance…

    will now be very costly.because there is so much at stake, it is wise to get yourself an aggressive criminal defense attorney that can actually help you. this is no time to look to save money and resort to using the…

  36. if he finds out that you are…

    suffering from any drinking related problem then you are bound to attend more than a simple defensive driving school. you are really obliged to seek treatment for your problem. this includes joining some drunk driving support groups, going to some outp…

  37. other smart phone can open your ex…

    up to the idea of being with you again.it may seem farfetched to some, but these are usually the people who underestimate text messages as a powerful and extremely useful form of communication that gives you incredible access to your ex…

  38. towards it. you need to schedule a…

    program of quitting and then set a daily target in the quitting program. stick to this gradual transition in the program so that by the end of a specified period of time, you are able to quit smoking for good.when you…

  39. cooking pork says:

    KIDS AND RECIPES…

    Merely blowing several free time on Delicious and I came across this page . Not typically a few things i prefer to discover, nonetheless it was definitely worth my time. Many thanks….

  40. SEO Company says:

    UK’s leading SEO Company…

    Offering a complete range of SEO services to match your budget….

  41. to allow a stranger to put them…

    in a “trance.”the shortcomings of traditional hypnotherapy have been overcome by an exciting new form of hypnotherapy known as nlp. nlp stands for neuro linguistic programming and it is a more powerful form of hypnotherapy that has proven to be extre…

  42. Legal Buds says:

    two packets a day were most at…

    risk of developing diabetes. this meant that for each 10,000 subjects in the study, around 30 of the women classed as heavy smokers were diagnosed with diabetes each year, in comparison with around 25 women who didn’t smoke, and hadn’t been…

  43. current lifestyle. hypnotherapy can aid you in…

    becoming more physically motivated if that is an issue.the final outcome of using hypnotherapy to become a non-smoker.the psychological advantages of becoming a non-smoker are vast. you will be highly confident as a result of this achievement and back …

  44. Hey…

    Merely wanna comment on few general things, The website style and design is perfect, the subject material is real excellent : D….

  45. to be around while you work out,…

    the iphone can be kept safe in this armband. draped in one of these amazingly designed artistic cases, your iphone will not only look great but also shielded from damage. whether you opt for a tough hard shell case with silicone…

  46. a company’s product or service. therefore, at…

    the very moment that a customer needs help someone who knows about the specific product information can tell them what to do. this is also very important especially for businesses in the medical field. live answering services can provide patients and…

  47. diet but walking out those sexy legs…

    would just be a whole lot better than doing nothing.back-to-the-basicspaleo diet, is not just an ordinary diet. it takes out a lot of modern-based agricultural foods and it takes a lot of guts in eliminating them from your diet. purely are…

  48. Hello…

    F*ckin’ amazing things here. I’m very glad to see your article. Thank you so much and i am taking a look forward to contact you. Will you kindly drop me a mail?…

  49. Hello…

    Keep up the fantastic piece of work, I read few articles on this internet site and I conceive that your website is real interesting and holds lots of wonderful information….

  50. Hi…

    I genuinely enjoy examining on this internet site, it holds fantastic posts. “One should die proudly when it is no longer possible to live proudly.” by Friedrich Wilhelm Nietzsche….

Leave a Reply

Security Code:

Free PageRank Checker

$7.49 .Com! Score Savings Cartoon Smart Tutorials

oDesk Certified Action Script Programmer oDesk Certified Adobe Flash CS3 Designer oDesk Certified Adobe Photoshop 6.0 Designer

3,036
Unique Visitors
Previous 30 Days
Powered By Google Analytics