Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure if this will solve your problem, but if I understand correctly, you basically want to be able to control a stage instance from an external script.</p> <p>If your "button" in this case is a flash object that you turned into a symbol, and chose to make the symbol of type "Button", then you'll want to make sure that, in the .fla file's library, you export that symbol for Actionscript.</p> <p>Control/right click on the library item that you made and go to "properties." From there, you'll want to check off the box "Export for Actionscript." You'll want to give this custom button object a class name (and the thing on your stage will be an instance of this class).</p> <p>Next: If your external .as document is called "MainTimeline.as", you'll probably want to make the document class of your .fla file "MainTimeline" (assuming it's in the same directory as your .fla file, which it appears to be). You can do this by clicking on the stage in your .fla file (or just deselecting everything else) and going into the properties menu box. In the part where it says Class: [<em>blank text area</em>], you'll want to fill in "MainTimeline". That will then mean that MainTimeline is the overall base class for this swf, and whatever instances you add to the stage should be accessible in this class (as if they were instances created by code in the actual .as file).</p> <p>In that MainTimeline.as file, if you put the following text into it and your button becomes invisible when you compile and run your swf, that should probably indicate that things are working.</p> <p>MainTimeline.as code to try out:</p> <pre><code>package { import flash.display.MovieClip; public class MainTimeline extends MovieClip { public function MainTimeline() { init.visible = false; } } } </code></pre> <p>Hope this helps!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload