Jump to content
Search Community

Simple Transform Around Center Tween

mularam test
Moderator Tag

Recommended Posts

Hi there

 

I am a noob Shockingly Green member who is having a little trouble with the Transform Around Centre + also Transform Around Point plugins.

 

I have applied both to buttons to create very simple tweens but get this message in the output panel:

 

ReferenceError: Error #1069: Property transformAroundCenter not found on flash.display.SimpleButton and there is no default value.

at com.greensock::TweenLite/com.greensock:TweenLite::init()

at com.greensock::TweenLite/renderTime()

at com.greensock.core::SimpleTimeline/renderTime()

at com.greensock::TweenLite$/com.greensock:TweenLite::updateAll()

 

I am having no trouble with other plugins such as glowfilter but these are causing problems.

 

My code is as follows:

btn_apple.addEventListener(MouseEvent.ROLL_OVER, over2);
btn_apple.addEventListener(MouseEvent.ROLL_OUT, out2);
btn_blueberry.addEventListener(MouseEvent.ROLL_OVER, over2);
btn_blueberry.addEventListener(MouseEvent.ROLL_OUT, out2);
btn_cherry.addEventListener(MouseEvent.ROLL_OVER, over2);
btn_cherry.addEventListener(MouseEvent.ROLL_OUT, out2);
btn_lemon.addEventListener(MouseEvent.ROLL_OVER, over2);
btn_lemon.addEventListener(MouseEvent.ROLL_OUT, out2);

function over2(event:MouseEvent):void {
TweenLite.to(event.target, 0.25, {transformAroundCenter:{scaleX:2, scaleY:2}, ease:Elastic.easeOut});
}
function out2(event:MouseEvent):void {
TweenLite.to(event.target, 0.25, {transformAroundCenter:{scaleX:1, scaleY:1}, ease:Elastic.easeOut});
}

 

Awesome product btw Jack - I've been looking for something to drag me off that timeline for a while now and this is simply beautiful!

Link to comment
Share on other sites

Sounds like you just forgot to activate the plugins.

 

import com.greensock.plugins.*;
TweenPlugin.activate([TransformAroundCenterPlugin, TransformAroundPointPlugin]);

 

Just do that once in your swf and you're golden. By the way, the Plugin Explorer will even write that code for you down below. Select the plugins you want and vwalla! copy/paste that code.

 

By the way, thanks for joining the club! Glad to hear you're diggin' the stuff.

Link to comment
Share on other sites

  • 1 year later...

Hi,

 

Im joining this post because i have the same issue but the solution does'nt help me.

I signup for a basic membership yesterday and i replaced my com.greensocks folder with the one ive downloaded in my member page.

 

In my project, i have a view class that extends eventDispatcher and my tween is started in a mouseOver handler.

I tried to activate the TransformArroundCenter pluggin everywhere in the class but always the same error (Error #1069)

 

Here is my code :

 

package view {

import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.layout.*;
import com.greensock.plugins.*;
TweenPlugin.activate([TransformAroundCenterPlugin, TransformAroundPointPlugin]);

       public class GalleryViewThumbs extends View {
...
	public function GalleryViewThumbs(c:Sprite) {
		super();
		trace(TweenPlugin.activate([TransformAroundCenterPlugin, TransformAroundPointPlugin]));//true
	}
//listener for model fully loaded
	override public function load(e:Event = null):void {
		trace("first load");
		loader = new Loader();
		loader.contentLoaderInfo.addEventListener(Event.INIT, imageLoaded);
	}
//model updated
	override public function update(e:Event = null):void {
		var request:URLRequest = new URLRequest(GalleryModelGetThumbs(model).urlSmall);
		loader.load( request);
	}
//load image init
	private function imageLoaded(evt:Event):void {

		var imgContainer:Sprite = new Sprite();
		imgContainer.name = String(myModel._currentIndex);
		container.addChild(imgContainer);
		var loaderImg:Bitmap = Bitmap(loader.content);
		imgContainer.name = String(myModel._currentIndex);

		imgContainer.addEventListener(MouseEvent.ROLL_OVER, onOver,false,0,true);
		imgContainer.addEventListener(MouseEvent.ROLL_OUT, onOut, false, 0, true);
		imgContainer.addEventListener(MouseEvent.CLICK, onClick);
	}
	private function onOver(e:MouseEvent):void {

		var loaderImg:Bitmap = e.currentTarget.getChildAt(0) as Bitmap;
		...

		TweenLite.from(loaderImg, 0.75, {TransformAroundCenter:{width:startWidth, height:startHeight}, ease:Back.easeIn});
	}
               }
}

 

Thanks you for your help and your big work

Link to comment
Share on other sites

When you say "basic membership", what do you mean? TransformAroundCenterPlugin and TransformAroundPointPlugin are only included in "Really Green" and above memberships. The lowest "Green" membership doesn't include that plugin. Have you checked the com/greensock/plugins/ folder to see if there's a TransformAroundCenterPlugin.as file in there?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...