Hi All,

I realize there are a few posts skirting around this issue but I am
still having some issues wrapping my mind around it.

What I am trying to do:
Extend an embedded SWF with more actionscript so as to make buttons
work in a moviematerial.

I have successfully embedded a movie material that retains its
actionscript, and made this work ( without extending it), but only if
the swf is self contained.


Some people  say that code gets stripped when you embed rather than
load a SWF in Flex, which is true in some instances, but not all. I
find it works fine IF you embed a SWF file as a whole, not just a
symbol within it.

Such as:


[Embed(source="/menu.swf")]
public static const MenuClass:Class;
public static const menu_SWFAsset:MovieClipAsset = new MenuClass();
public static const menu_Tex:MovieMaterial = new MovieMaterial
(menu_SWFAsset);


However... I have more actionscript for the buttons that must be
activated outside of the flash publishing of this swf to avoid
conflicts that happen when a swf imports stuff that also tells it to
embed itself through extension, among other things.

So...

1. I have menu.swf, it has a button in it on the stage called home.

2. I publish the menu.swf with no document class speciified.

3. It gets embedded as above.


How do i access the instance of home? I realize this maybe a scope
issue or just my lack of understanding of classes and targetting and
extending... any help would be appreciated dearly!

In flex I tried to create a package and class like this:


  public class Menu extends flash.display.MovieClip
    {

        public var home:Button;

public function Menu()
        {

home.addEventListener(MouseEvent.MOUSE_DOWN, onHomeClick);

  private function onHomeClick(event:MouseEvent) : void
        {
          trace("home clicked");


            return;
        }// end function

}




Unfortunately, nothing happens when I click on the button...  Any
ideas?

Reply via email to