actionscript 3 - Adding a MovieClip from inside a class method -


I am trying to add a movie clip to my .fla file from a classic.

My main Fla file: main.fla actionscript file: script.as

They live in the same directory.

The script.as file is as follows:

  package {import flash.display. * Expansion of the public category of the movie Movie Clip (Public Var Target): Movie Clip; Public Function: Mylace () {init (); } Public function init () // If this method is only run within the classroom then it should not be private (trace ('created');} create public function () {target = new myfan (); Target.x = 400 ; Target.y = 50; stage.addChild (target);}}  

}

I create a function to add movie clips from the main.fla file .

  var is trying: MyClass = New MyClass (); trying.create ();  

returns the "created" output, but I Output the "Muffin" movie clip inside the SDF file

I'm searching all day but not much.

How do I add a movie clip to a class file?

Thanks for your help.

I'm a bit confused about how you're scripting the script Classes should be in the form of a class name with the same name in AS3 - hence the name of your file is MyClass.as

The second question is: myfan Absolutely? Is this a symbol in your library? What is included in that symbol? What if you used the action script to drag the symbol on the symbol instead of trying to turn it on?

Finally, if you are doing MyClass , why are you doing this? On the first frame of the movie within the timeline? I think that you are not adding variables to in the display list at any time .... This means that the variable stage can be added to zero Try:

  create public functions () {target = new myfan (); Target.x = 400; Target.y = 50; Trace ("forum here?: Forum,"); Stage.addChild (target); }  

To see if you get something.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -