Hello all,

I am trying to load an swf file which has button skins as images (In
the library of the swf file i have given export properties which is
'TickMark') and set the skin of a flex button using
StyleManager.setStyleDeclaration.

I am getting errors like 'Argument count mismatch on TickMark().
Expected 2, got 0.'

This is what i am trying to do:

 private function init():void
            {
             loader = new Loader();
 
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,styleSWFLoaded);
             loader.load(new URLRequest("styles.swf"),new
LoaderContext(false,ApplicationDomain.currentDomain));

            }

  private function createStyle(styleName:String):void
            {

             var style:CSSStyleDeclaration = new
CSSStyleDeclaration(styleName);


                var cls:Class =
ApplicationDomain.currentDomain.getDefinition("Tick") as Class;

                style.setStyle("upSkin",cls);

              }
             }
             StyleManager.setStyleDeclaration(".buttonme",style,true);
            }

When I apply this new style 'buttonme' to a button i am getting below
error:

ArgumentError: Error #1063: Argument count mismatch on TickMark().
Expected 2, got 0.

Not sure why is this happening, and strange thing is, when I embed the
same swf file it works, like below:

[Embed(source="styles.swf", symbol="Tick")]
private var GraphicClass:Class;

If I use the class GraphicClass in setStyleDeclaration, it works...
but basically I want it dynamically.

Or there are other easy methods to skin (image) a flex button
dynamically?

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to flex_in...@googlegroups.com.
To unsubscribe from this group, send email to 
flex_india+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to