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:

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

1,462 Responses to “Discovering and Referencing Instance Names”

  1. hausratversicherung vergleichl Says:

    Hola! I’ve been following your site for a long time now and finally got the courage to go ahead and give you a shout out from Atascocita Tx! Just wanted to mention keep up the excellent job! hausratversicherung vergleich

  2. immobilienfinanzierung rechnerj Says:

    Wow! This blog looks exactly like my old one! It’s on a entirely different subject but it has pretty much the same page layout and design. Outstanding choice of colors! immobilienfinanzierung rechner

  3. sofortkredit ohne schufat Says:

    Hi! I know this is kinda off topic however , I’d figured I’d ask. Would you be interested in trading links or maybe guest authoring a blog post or vice-versa? My site covers a lot of the same topics as yours and I feel we could greatly benefit from each other. If you are interested feel free to shoot me an email. I look forward to hearing from you! Great blog by the way! sofortkredit ohne schufa

  4. zinsrechnung formele Says:

    I know this if off topic but I’m looking into starting my own weblog and was curious what all is needed to get set up? I’m assuming having a blog like yours would cost a pretty penny? I’m not very web savvy so I’m not 100% positive. Any suggestions or advice would be greatly appreciated. Cheers zinsrechnung formel

  5. haus finanzierenf Says:

    First of all I want to say superb blog! I had a quick question that I’d like to ask if you do not mind. I was interested to find out how you center yourself and clear your head before writing. I have had a tough time clearing my mind in getting my thoughts out there. I truly do enjoy writing but it just seems like the first 10 to 15 minutes are usually lost just trying to figure out how to begin. Any suggestions or hints? Cheers! haus finanzieren

  6. Judith Says:

    What a great blog

  7. krankenkasse vergleichb Says:

    Have you ever considered creating an e-book or guest authoring on other websites? I have a blog centered on the same ideas you discuss and would love to have you share some stories/information. I know my audience would appreciate your work. If you’re even remotely interested, feel free to send me an e-mail. krankenkasse vergleich

  8. privatkredit vergleichy Says:

    Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You clearly know what youre talking about, why throw away your intelligence on just posting videos to your site when you could be giving us something informative to read? privatkredit vergleich

  9. stoffwechsel anregenf Says:

    Does your blog have a contact page? I’m having problems locating it but, I’d like to send you an email. I’ve got some ideas for your blog you might be interested in hearing. Either way, great site and I look forward to seeing it expand over time. stoffwechsel anregen

  10. kreditrechner immoibilieno Says:

    We absolutely love your blog and find many of your post’s to be just what I’m looking for. Does one offer guest writers to write content for you? I wouldn’t mind composing a post or elaborating on most of the subjects you write in relation to here. Again, awesome web log! kreditrechner immoibilien

  11. finanzierungsrechner immobilienz Says:

    My spouse and I stumbled over here from a different web page and thought I should check things out. I like what I see so now i am following you. Look forward to looking at your web page again. finanzierungsrechner immobilien

  12. stoffwechsel ankurbelnj Says:

    Have you ever thought about including a little bit more than just your articles? I mean, what you say is important and all. Nevertheless just imagine if you added some great visuals or video clips to give your posts more, “pop”! Your content is excellent but with images and video clips, this site could definitely be one of the very best in its field. Superb blog! stoffwechsel ankurbeln

  13. bauzinsen aktuellh Says:

    Hey there are using Wordpress for your blog platform? I’m new to the blog world but I’m trying to get started and create my own. Do you need any coding expertise to make your own blog? Any help would be really appreciated! bauzinsen aktuell

  14. hausfinanzierung rechnero Says:

    Good day! This is kind of off topic but I need some guidance from an established blog. Is it tough to set up your own blog? I’m not very techincal but I can figure things out pretty fast. I’m thinking about creating my own but I’m not sure where to start. Do you have any points or suggestions? Cheers hausfinanzierung rechner

  15. rezepte ohne kohlenhydrateh Says:

    Hi would you mind sharing which blog platform you’re working with? I’m going to start my own blog soon but I’m having a hard time deciding between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your layout seems different then most blogs and I’m looking for something completely unique. P.S Sorry for being off-topic but I had to ask! rezepte ohne kohlenhydrate

  16. zinsrechner onlinei Says:

    I’m curious to find out what blog system you’re using? I’m experiencing some minor security issues with my latest site and I would like to find something more safe. Do you have any recommendations? zinsrechner online

  17. verzugszinsen berechnend Says:

    Hmm is anyone else encountering problems with the pictures on this blog loading? I’m trying to figure out if its a problem on my end or if it’s the blog. Any feed-back would be greatly appreciated. verzugszinsen berechnen

  18. fettarme rezepteb Says:

    Sweet blog! I found it while surfing around on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Thank you fettarme rezepte

  19. rechtsschutzversicherung testq Says:

    Hey! I know this is somewhat off topic but I was wondering which blog platform are you using for this website? I’m getting tired of Wordpress because I’ve had problems with hackers and I’m looking at alternatives for another platform. I would be awesome if you could point me in the direction of a good platform. rechtsschutzversicherung test

  20. baufinanzierungs rechner onlinej Says:

    My spouse and I stumbled over here from a different web page and thought I should check things out. I like what I see so now i am following you. Look forward to looking at your web page again. baufinanzierungs rechner online

  21. Gruener tee wirkungp Says:

    I’m really enjoying the theme/design of your website. Do you ever run into any browser compatibility problems? A couple of my blog readers have complained about my blog not operating correctly in Explorer but looks great in Chrome. Do you have any solutions to help fix this issue? Gruener tee wirkung

  22. buy ambien online Says:

    ambien without prescription – purchase ambien online no prescription


Trackbacks/Pingbacks

  1. forex free…

    Aw, this was a really nice post. In thought I wish to put in writing like this additionally – taking time and actual effort to make an excellent article… but what can I say… I procrastinate alot and under no circumstances seem to get something done….

  2. oil change says:

    boil. the best way to peel the…

    garlic clove is to place it in the microwave for five to ten seconds. place under a knife and lightly mash on it. the skin should come off pretty easy. dice the garlic cloves and add to the water so it…

  3. Tumblr article…

    I saw a writer talking about this on Tumblr and it linked to…

  4. Sources…

    [...]check below, are some totally unrelated websites to ours, however, they are most trustworthy sources that we use[...]……

  5. [...]we like to honor many other internet sites on the web, even if they aren’t linked to us, by linking to them. Under are some webpages worth checking out[...]……

    [...]Here are some of the sites we recommend for our visitors[...]……

  6. also include white patches in the mouth…

    and on the tongue, along with difficulty swallowing. vaginal yeast infections may also include a white, thick, clumpy, and odorless discharge, along with burning while urinating.there are several options to treat common symptoms. effective over-the-cou…

  7. put at grave danger.these situations are why…

    marine lcd monitors have to be so rugged, in certain situations the display failing is simply not an option. in a naval military boat duplicate systems do exist but in the event of failure the swap over may not be automatic,…

  8. LED v LCD says:

    be able to get a digestive tract…

    infection is by the particular foods you might be consuming. high sugar, carbohydrate or alcohol consumption might result in a digestive tract candida infection. alcohol and carbohydrates convert to sugar when broken down by the body. yeast thrive on s…

  9. internet connection will allow you to watch…

    your favourite videos from youtube and stream your favourite movies from various channels. doing video chatting through skype is another fun activity to do. normally, people only do it on a laptop or computer screen that is not that big, but…

  10. some people will just take them when…

    they see them laying around. you should not only worry about somebody stealing your iphone, you need to be careful as to what you do with it as well.i know what you are thinking, “how tough can it be to keep…

  11. nerve 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[...]……

  12. Superb website…

    [...]always a big fan of linking to bloggers that I love but don’t get a lot of link love from[...]……

  13. Online Article……

    [...]The information mentioned in the article are some of the best available [...]……

  14. Websites worth visiting…

    [...]here are some links to sites that we link to because we think they are worth visiting[...]……

  15. not to go into personal details at…

    this point in the letter, so just acknowledge the deceased’s passing and your sympathy. keep it simple, and keep it kind. remember, this was their parent, or brother or sister. there will be deep feelings of sadness present, in spite of…

  16. to stop smoking or not. sleepless again?…

    instead of reaching for a pill, you may want to consider trying herbs for sleep instead. people have been using herbal sleep remedies for centuries. sipping a warm cup of soothing herb tea may help you drift off to dreamland sooner…

  17. Bored at work…

    I like to surf in various places on the online world, often I will just go to Stumble Upon and follow thru…

  18. Digg this…

    While checking out DIGG yesterday I noticed this…

  19. contemporary rugs…

    [...]Here is a superb Blog You may Obtain Exciting that we Encourage You[...]…

  20. powerpoint design…

    [...]The data talked about in the report are a number of the very best offered [...]…

  21. and support provided in times of stress…

    and is a remedy for nervous tension, headaches, agitation, anxiety, insomnia, hysteria, exhaustion and depression.skullcap is an antispasmodic which is useful for twitching muscles, trembling, epilepsy and heart palpitations. it useful as an aid when w…

  22. completing its task. you only require to…

    put some water into it and watch it cleansing itself automatically.3. elegance: if a machine could perform almost everything and it is physically not attractive to the eyes. then that machine lacks perfection. vita mix machine is elegantly designed. it…

  23. those who are fishing for the first…

    time in these waters will also never forget the experience of being in these waters.4. an enjoyable experience for the family this expedition is equally enjoyable for those of the family who are not into fishing as they can relax in…

  24. be on the lookout for such promotional…

    offers, especially if you are about to purchase something. getting a free coupon with the item that you have purchased increases your chance of winning the prize mentioned upon the coupon.online websites there is a large collection of websites on the…

  25. and near downtown los angeles.orange countynearby orange…

    county is the go-to zone for those who enjoy being done with the city after a hard days work. orange county offers everything from trendy and close-to-civilization living while still allowing its residents to get a feel for the peaceful and…

  26. remain unsolved this way? how many customers…

    remain mr angry this way? if ever a business needed a call answering service it’s business that doesn’t have the man power or the capability to answer it’s own calls. come on, this should be a thing of the past.business needs…

  27. Superb website…

    [...]always a big fan of linking to bloggers that I love but don’t get a lot of link love from[...]……

  28. Great website…

    [...]we like to honor many other internet sites on the web, even if they aren’t linked to us, by linking to them. Under are some webpages worth checking out[...]……

  29. Blogs ou should be reading…

    [...]Here is a Great Blog You Might Find Interesting that we Encourage You[...]……

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,012
Unique Visitors
Previous 30 Days
Powered By Google Analytics