PDA

View Full Version : Distortion Effects Package use in Actionscript 3 only project


firdosh
12-03-2006, 06:18 PM
If you havent checked out the Ditortion Effects its at
http://weblogs.macromedia.com/auhlmann/archives/2006/11/download_distor.cfm#more

Some real cool stuff.

I had emailed Alex about this package and he said that you can use it in a Actionscript 3 only project but I am not sure since it extends a few mx classes.

import mx.core.Container;
import mx.core.ContainerCreationPolicy;
import mx.core.IFlexDisplayObject;
import mx.core.UIComponent;
import mx.core.mx_internal;
import mx.effects.Tween;
import mx.effects.effectClasses.TweenEffectInstance;

So tried setting up the AS3 project

package {
import flash.display.Sprite;
import com.adobe.ac.mxeffects.CubeRotate;
import com.adobe.ac.mxeffects.DistortionConstants;
import flash.display.Shape;
import mx.core.mx_internal;

use namespace mx_internal;

[SWF(width="800", height="600")]
public class WebSiteEffects extends Sprite
{
public function WebSiteEffects()
{

var redRect:Shape=new Shape();
redRect.graphics.lineStyle(0,0,1,true);
redRect.graphics.beginFill(0xff0000,1);
redRect.graphics.drawRect(10,10,200,200);
redRect.graphics.endFill();
this.addChild(redRect);

var grRect:Shape=new Shape();
grRect.graphics.lineStyle(0,0,1,true);
grRect.graphics.beginFill(0x0000ff,1);
grRect.graphics.drawRect(250,250,200,200);
grRect.graphics.endFill();
this.addChild(grRect);

var e : CubeRotate;
e = new CubeRotate( redRect );
e.siblings = [redRect];
e.direction = DistortionConstants.LEFT;
e.duration = 1000;
e.play();


}
}
}


And these are the compile time errors I get

Severity Description Resource In Folder Location Creation Time Id
2 Unable to resolve a class for ResourceBundle: core. WebSiteEffects December 3, 2006 2:25:28 PM 601
2 Unable to resolve a class for ResourceBundle: core. WebSiteEffects December 3, 2006 2:25:28 PM 602
2 Unable to resolve a class for ResourceBundle: core. WebSiteEffects December 3, 2006 2:25:28 PM 603
2 Unable to resolve a class for ResourceBundle: core. WebSiteEffects December 3, 2006 2:25:28 PM 604
2 Unable to resolve a class for ResourceBundle: effects. WebSiteEffects December 3, 2006 2:25:28 PM 605
2 Unable to resolve a class for ResourceBundle: skins. WebSiteEffects December 3, 2006 2:25:28 PM 606





thanks
cheers :)
firdosh

Flash Gordon
12-03-2006, 06:31 PM
Are you asking if this can be done is AS 2.0?

firdosh
12-03-2006, 07:39 PM
No, I am trying to use the existing classes with an AS3 only project

Tink
12-04-2006, 07:34 AM
it requires the Flex framework i would have thought

firdosh
12-04-2006, 02:41 PM
so I cant just use it in an AS3 only project right ??

firdosh
12-05-2006, 06:18 PM
I got an email from Alex Uhlmann saying that

the current distortion effects are AS3 only. You can use them in AS and MXML

but the base DitortionTwen class extends

mx.effects.effectClasses.TweenEffectInstance;

so this shouldnt work in an AS3 only project right ? or am I gettign this all wrong ?

firdosh