SACC




When using Actionscript 3.0 you do not use attachMovie()

  1. Open Flash by clicking on the icon on the dock



  2. Create a new document of type Actionscript 3.0



  3. Save the document in your work folder



  4. Insert a New Symbol.



  5. Make the New Symbol a movieclip. Give it a name. Make sure Advanced is selected:



  6. Give the movie clip a name and Export for Actionscript. Flash will create a class for your movieclip with the same name as the clip.


  7. Use the painting tools to create an image.


  8. Go to Scene 1



  9. Click on frame 1 and open an Actionscript window.


  10. To attach the movie clip you just made to the Stage, use the following syntax:
         var your_var_name:your_class_name=new your_class_name();
         addChild(your_var_name);
         your_var_name.x=horizontal_value;
         your_var_name.y=vertical_value;
         

    For example, if my movieclip and class are named myMC and I want to center it:
    var mc:myMC=new myMC();
    addChild(mc);
    mc.x=stage.stageWidth/2-mc.width/2;
    mc.y=stage.stageHeight/2-mc.height/2;
          


  11. Test, save, publish and link.