shape layout clips shifted when loading hype swf in another one

15 views
Skip to first unread message

arne

unread,
May 24, 2011, 10:08:31 AM5/24/11
to HYPE Framework
hi
(i already posted this on the website)

i’ve made my shape layout – everything works fine except when i load
my swf in another one (in a browser centered Gaia framework site to be
more precise)
the shape appear in the right place but the clips are shifted plus
it’s like that only one part of the shape is recognize??
do you have an idea?

arne

unread,
May 24, 2011, 11:22:34 AM5/24/11
to HYPE Framework
ok i reply to myself - the issue is of course the stage dimensions

how could i manage this??

code of my Gaia page :

package vuittonAV.pages {
import hype.extended.layout.ShapeLayout;
import hype.framework.core.ObjectPool;
import hype.framework.display.BitmapCanvas;
import hype.framework.rhythm.SimpleRhythm;

import com.gaiaframework.templates.AbstractPage;
import com.greensock.TweenMax;
import com.greensock.easing.Elastic;

import flash.display.*;
import flash.events.MouseEvent;
import flash.system.ApplicationDomain;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;

public class DicoPage extends AbstractPage
{
private var motsTab:Array = new
Array("word1","word2","word3","word4");

private var pool:ObjectPool;
private var layout:ShapeLayout;
private var rythm:SimpleRhythm;

public var MyShape;

public function DicoPage()
{
super();

MyShape.visible = false;

var textCont : Class =
ApplicationDomain.currentDomain.getDefinition("TextObject") as Class ;

pool = new ObjectPool(textCont,300);
layout = new ShapeLayout(MyShape);

var format:TextFormat = new TextFormat();
format.align = TextFormatAlign.CENTER;

pool.onRequestObject = function(clip) {
var alea=Math.floor(Math.random() * motsTab.length);
var alea2 = (Math.random()) + 0.25;

clip.texte.defaultTextFormat = format;
clip.texte.text = motsTab[alea];
clip.texte.wordWrap=false;
clip.texte.autoSize = TextFieldAutoSize.LEFT;
clip.bg.width = clip.texte.textWidth;
clip.bg.x = clip.texte.x + clip.bg.width/2;

clip.texte.scaleX = clip.texte.scaleY = alea2;

clip.texte.alpha = alea2;
clip.alea2= alea2;

layout.applyLayout(clip);
addChild(clip);

clip.buttonMode =true;
clip.mouseChildren = false;
clip.addEventListener(MouseEvent.ROLL_OVER,overTexte);
clip.addEventListener(MouseEvent.ROLL_OUT,outTexte);

TweenMax.from(clip, 1, {scaleX:0,scaleY:0,alpha:0});

};


rythm = new SimpleRhythm(populatePool);
//pool.requestAll();
rythm.start();

}

private function populatePool(r:SimpleRhythm) : void
{
pool.request();
}

private function overTexte(event : MouseEvent) : void {
addChild(DisplayObject(event.currentTarget));
TweenMax.to(event.currentTarget.texte,4,{scaleX:3,scaleY:3,alpha:1
,glowFilter:{color:0xffffff, alpha:1, blurX:30, blurY:30, quality:
2, strength:3}
,ease:Elastic.easeOut

});
}
private function outTexte(event : MouseEvent) : void {
var alea = event.currentTarget.alea2;
TweenMax.to(event.currentTarget.texte,4,{
scaleX:alea
,scaleY:alea
,alpha:alea
,glowFilter:{color:0xffffff, alpha:0, blurX:30, blurY:30, quality:
2}
,ease:Elastic.easeOut
});
}

override public function transitionIn():void
{
super.transitionIn();
TweenMax.to(this, 0.3, {alpha:1, onComplete:transitionInComplete});
}
override public function transitionOut():void
{
super.transitionOut();
TweenMax.to(this, 0.3, {alpha:0,
onComplete:transitionOutComplete});
}
}
}
Reply all
Reply to author
Forward
0 new messages