Try wrapping your component in UIComponent, and then apply the effect to this new component.
I though about that too.
I didnt try it but I think its not going to work.
I have to make the situation a little more clear. The movie clip I'm trying to animate is a child of the whole component. So, I guess that if I try to animate the whole navigation menu then I'm not gonna get an error. But trying to animate a child movie clip of the component throws the error.
Let me know if I'm assuming something wrong.
I'm afraid nearly every spark and halo Effect require UIComponent or IUIComponent as effect target, but I've made some test and it is possible to use AnimateProperty with MovieClip instance and it seems to work fine, here is a very simple example:
<?xml version="1.0" encoding="utf-8"?>
<mx:AnimateProperty property="alpha" toValue="0.2"/>
<mx:AnimateProperty property="alpha" toValue="1"/>
<mx:AnimateProperty property="x" toValue="300"/>
<mx:AnimateProperty property="y" toValue="300"/>
protected function application1_creationCompleteHandler(event:FlexEvent):void
var mc:MovieClip = new MovieClip();
mc.graphics.drawRect(0, 0, 100, 100);
Note that this is Flex 4 example.
thanks for the reply.
One question though,
I cant understand the purpose of this line : uiComp.addChild(mc);
Eventually, the Sequence will have the mc as a target. so why adding it to a uiComponent?
Does it matter what's the parent of the movie clip in order to animate the movie clip itself?
If so, then this solution would definetely work but I would have make some adjustments to my flash components.
1 person found this helpful
I've wrapped mc in uiComp because in Flex, children of containers have to be UIComponents. If you try to add non UIComponent as a child to Application container or any other container, you'll get an error. It should work in your component, and the best way to check it, is try:)