Skip navigation
Currently Being Moderated

Do MC’s from a graphic need placing on stage ?

Nov 14, 2012 5:05 AM


Flash CS5

I have a graphic on stage with a series of spots and names representing settlements. I have double clicked my way into it and selected a spot and name, made it a MovieClip and given it an instance name. Repeated this for each and every spot/name .


Are those MC’s now on stage hiding behind the graphic or do they need placing there ?


If I return to stage and select a spot/name I get still the graphic selected.


I wish to code this such that a settlement spot only appears when coding makes that MC visible.


I don’t wish to see that graphic of them all displayed now.


Do I need to drag drop each and every MC from Lib onto stage and position over the same settlement in graphic, then turn graphic layer into a guide layer to stop it appearing when movie runs ?...or is it sufficient to delete the graphic after making these MC’s from it and only the MC’s  will appear when told to do so by coding ?


If not and I do need to drag drop each MC from Lib to stage, is manual placement over the graphic the best way ?

It would seem so as if one d/clicks the graphic and selects the MC in the top left corner, properties shows e.g. x 0 y 0

If I drag drop that MC from Lib to stage and make it x 0 y0 in properties, it sits in a different location, top left of stage, so obviously the first x0 y0 is its position within the graphic and not within the stage.


To avoid this double labour, is there a way of making each settlement spot and name into a graphic and have it use that location on stage without needing to be drag dropped from Lib to that location ?



  • Currently Being Moderated
    Nov 14, 2012 5:20 AM   in reply to Envirographics

    If you created each spot as a movieclip within the graphic that is on the stage, then the movieclips are on the stage within the graphic.  You do not need to drag anything in at this stage.


    If you do not want to see them you need to target them with code and either set their visible property to false or their alpha properrty to zero.  If that is truly a graphic symbol that they are sitting in, then you need to change it to being a movieclip symbol so that you can assign it an instance name just like you did for the spots and then you can use that name to target the inner movieclips to make them invisible... as in...


    graphicName.spotName.visible = false;  (this assumes AS3 is being used)

    Mark as:
  • Currently Being Moderated
    Nov 14, 2012 6:55 AM   in reply to Envirographics

    If I delete the graphic off stage, do I also kill the MC's  ?


    Anything that is in your library can only be deleted (killed) if you delete them from the library.  Removing them from the stage does not delete them from the library... you should be able to see this if you try.


    There are ways to code using loops to minimize the amount of code you need to use.  Here are a few ways to consider


    By naming things with specific names like "DrewsBottom" rather than something generic like "mc1", "mc2", etc..., you are creating a scenario where more coding is needed. If you go the generic route you can create loops to go thru numerous objects with just a few lines.


    You could place all of the specific object instance names into an array and still use a loop to make them all visible/invisible, but that still requires you to have the specific names written into the array.


    If the objects within the settlements movieclip were the only children of that movieclip, then you could loop thru them all using the numChildren property and getChildAt() method.

    Mark as:
  • Currently Being Moderated
    Nov 14, 2012 8:15 AM   in reply to Envirographics

    If you delete the object from the stage, you cannot do anything with it since it does not exist.  You could add the object dynamically using code, but I don't think that is what you are looking for since you seem to want to use rollovers to make things happen... something has to exist for the rollover to be recognized.


    If the event listeners are on mc1, mc2, etc, then you can use the event.currentTarget to target the object that was rolled over.

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points