Thanks for those pointers Phil -- it still gives me a "base class not found" error in the AS file (on the class definition) when I try to make it public. I've got my updated code below.

The strange thing is that if I do an import of mx.effects.* first and extend TweenEffect it doesn't give that base class error but "conflict with inherited definition target in namespace public" for the target property and "incompatible override" and "overriding function that is not marked for override" for the playEffect method.


testEffect.mxml

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="com.peterelst.*">  
  <mx:Effect>
    <Rotate name="myRotateEffect" rotateBy="1000" duration="1000" />
  </mx:Effect>
  <mx:Image id="myAnimation" source="@Embed('flash_platform.jpg')" mouseDownEffect="myRotateEffect" />
</mx:Application>


Rotate.as

package com.peterelst {

    public class Rotate extends mx.effects.TweenEffect {
       
       var target:Object;
       var rotateBy:Number;
       var rotateTween:mx.effects.Tween;
          
       function Rotate(targetObj:Object)   {
          target = targetObj;
       }
          
       function playEffect():Void   {
            rotateTween = new mx.effects.Tween(this, target._rotation,
            target._rotation+rotateBy, duration);
       }
          
       function onTweenUpdate(tweenValue):Void   {
          target._rotation = tweenValue;
       }
          
    }

}






On 10/19/05, Philip Costa <[EMAIL PROTECTED]> wrote:
You have to mark your class public.
 
The default in AS3 is private, so that's why your MXML page can't see it.
 
Phil Costa
Sr. Product Manager
Macromedia



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to