Discovering and Referencing Instance Names

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 Remove Items from Stage by Instance Name
// 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 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 ("instance13"));

// this will remove the child with the name instance 13 from stage.
}

Related Articles:

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

91 Responses to “Discovering and Referencing Instance Names”


Trackbacks/Pingbacks

  1. Learn More says:

    nice site…

    click here…

  2. learn more says:

    ab346368@gmail.com

    Wonderful article! I wish I had your insight on this topic and could write as well as you. I hope many people get the opportunity to enjoy this great content….

  3. ab346368@gmail.com

    Rustic handmade wood furniture -…

  4. ab346368@gmail.com

    {Beautiful and Distinctive Oak Furniture hand made from the best Oak Wood….

  5. ab346368@gmail.com

    {Beautiful and Distinctive Oak Furniture hand built from the best Oak Wood….

  6. ab346368@gmail.com

    Thank you for giving readers like me varied viewpoints to consider. Your article has made me think about this subject in a completely different way….

  7. Now That’s What I {Call|Consider} Style…

    Really nice design and superb content , hardly anything else we need : D….

  8. phen375 scam says:

    ab346368@gmail.com

    This is one fantastic article! I am really impressed with all the work you did to gather this information and write the material. You’ve done a wonderful job with making this unique and engaging content….

  9. ab346368@gmail.com

    This is awesome reading material! It’s packed with useful info that anyone can read and understand. I love to read articles by writers that truly care about the content they produce and share. Thank you….

  10. ab346368@gmail.com

    This article is really well researched. I think this content is valuable information that you have written in a unique way. You’ve represented your views in an interesting, engaging way that makes your readers think….

  11. ab346368@gmail.com

    I have been reading a lot on this topic lately, but your info is great. You have written your article in a most unique manner….

  12. Look here for more:…

    [...]you made running a blog glance[...]…

  13. ab346368@gmail.com

    It’s so great to know you are a writer that cares about the information you provide. This is smartly done and well-written in my opinion….

  14. ordenadores says:

    ab346368@gmail.com

    I make my living writing, but I am not nearly as good as you. I’m not sure I would have the focus to do all the homework you’ve done on this topic. This is great….

  15. ab346368@gmail.com

    Your article is the most impressive I have read on this subject in many years. It’s a refreshing twist. I like your point of view….

  16. ab346368@gmail.com

    I haven’t been interested in an article like yours in a long time. Your take on this subject pulls a lot of weight with me. Your article is very intelligent and I enjoyed reading it….

  17. ab346368@gmail.com

    You have impeccable writing skills! You make some valid points with which I agree and I think this is really great reading material. Thank you….

  18. …Trackback: More Informations on that topic…

    [...]Wow, awesome blog layout! How long have you been blogging for?[...]…

  19. …A Friend recommended your blog…

    [...]Wow, fantastic weblog structure! How lengthy have you ever been running a blog for?[...]…

  20. ab346368@gmail.com

    Bonjour, j’ai bien apprécie cet article et j’en profite également pour proposer une ressource précieuse qui traite des arnaques sur internet, par exemple sur paypal : Arnaques Paypal. Merci encore pour cet article !…

  21. Intivar says:

    Intivar…

    click to know…

  22. ab346368@gmail.com

    If you haven’t tried to publish this type of article in a major paper, you should give it a try. It needs to be available to as many people as possible. This is amazing information….

  23. ab346368@gmail.com

    Words are something you are apparently good with as seen in this article. I think you have a lot of great wisdom on this subject. I like your writing style….

  24. ab346368@gmail.com

    The quality of this informative article is very high. This can only mean your own standards are set at a very high level. Please, continue your work in this area….

  25. yahoodsl says:

    …Links…

    [...]After I initially commented I clicked the -Notify me when new feedback are added- checkbox and now every time a remark is added I get 4 emails with the identical comment. Is there any manner you may take away me from that service? Thanks![...]…

  26. ab346368@gmail.com

    You have a true writing talent which is evidenced by this informative article. Your presentation and unique views are expressed well, smart and interesting. You and I have like minds….

  27. baccarat says:

    ab346368@gmail.com

    I enjoy brain-stimulating content like this. I have no issue with any of the information here. I agree with a good deal of the points mentioned in this excellent article….

  28. Kiosks says:

    ab346368@gmail.com

    I just have to tell you that you have really outdone yourself with this quality article presentation. I am very fascinated with the points you make here and I am in complete agreement with you….

  29. ab346368@gmail.com

    I added this article to my favorites and plan to return to digest more soon. It’s easy to read and understand as well as intelligent. I truly enjoyed my first read through of this article….

  30. ab346368@gmail.com

    It’s great when an article gives readers the opportunity to consider the many points mentioned. I like this article a lot and it’s very interesting….

  31. ab346368@gmail.com

    Geat post keep me interersted the whole time…

  32. wood beds says:

    ab346368@gmail.com

    Some of your article content gives rise to some debate on various points, but I think you have this all figured out. Your content is interesting as well as informative….

  33. ab346368@gmail.com

    I haven’t been this interested in article content like this in a long time. I appreciate all the effort you put into researching this. You’ve represented your viewpoint well and sparked interest in your readers….

  34. tatuaggi says:

    Title…

    Ugh that was odd. I just wrote an extremely detailed response but after I clicked send my comment didn’t show up. Hmmm… well I’m not typing all that again. Anyways, just wanted to say fantastic blog!…

  35. SEO Company says:

    Title…

    Man that was odd. I just wrote an extremely detailed response but after I clicked send my comment didn’t show up. Grrrr… well I’m not writing all that again. Anyways, just wanted to say great blog!…

  36. SEO Company says:

    Title…

    Wow, I’m sincerely happy that I clicked on this page, good info here! Better than http://facebook.com!…

  37. SEO Perth says:

    Title…

    Wow, I’m sincerely happy that I landed on this page, good info here! Better than http://google.com!…

  38. carrier bags says:

    carrier bags…

    [...]very handful of internet websites that happen to be detailed beneath, from our point of view are undoubtedly properly worth checking out[...]…

  39. SEO Perth says:

    Title…

    Wow, I’m really happy that I landed on this page, good info here! Better than http://google.com!…

  40. SEO Perth says:

    Title…

    Ugh, I just wrote a long comment, but it disappeared when I hit send. Anyway, I’m not going to redo it again, so I just wanted to say great blog! Better than http://facebook.com! :-)

  41. apply for credit card…

    [...]Here are a number of the web sites we advocate for our visitors[...]…

Leave a Reply

You must be logged in to post a comment.

My name is Avraham Saltoun, and I live in Jerusalem, Middle East. I am currently on my mid  40's and I am a computer programming technician. Here you will find over one hundred quality video tutorials on Actionscript, and yes, I give online support for aspiring programmers, and pros as well, sharing screen on skype and delivering source code by email, click the button for live flash actionscript support now!

 
oDesk Certified Action Script Programmer
oDesk Certified Adobe Flash CS3 Designer
oDesk Certified Adobe Photoshop 6.0 Designer
Skype Me™!

$7.49 .Com! Score Savings Cartoon Smart Tutorials


839
Unique Visitors
Previous 30 Days
Powered By Google Analytics