Mousefollow not working in AIR?

12 views
Skip to first unread message

andreas

unread,
Jan 6, 2012, 2:11:11 PM1/6/12
to HYPE Framework
Hey there,

This is weird... The mousefollow works in this code exporting as
normal swf... changing the publish settings to AIR and the proximity
seems to work, but not the mouseFollow. I appreciate any help. Thanks!

import hype.extended.behavior.SimpleProximity;
import hype.extended.layout.GridLayout;
import hype.framework.core.ObjectPool;
import hype.framework.display.BitmapCanvas;
var myWidth = stage.stageWidth;
var myHeight = stage.stageHeight;
var bmc:BitmapCanvas = new BitmapCanvas(myWidth, myHeight);
addChild(bmc);
var clipContainer:Sprite = new Sprite();
// myBackground.cacheAsBitmap = true;
clipContainer.cacheAsBitmap = true;
myBackground.mask = clipContainer;
var pool:ObjectPool = new ObjectPool(MyCircle, 276);
// xStart, yStart, xSpacing, ySpacing, columns

var layout:GridLayout = new GridLayout(45, 42, 25, 25, 23);
pool.onRequestObject = function(clip) {
clip.scaleX = clip.scaleY = 0.0;
layout.applyLayout(clip);
// object, property, spring, ease, min, max, radius
var sProx:SimpleProximity = new SimpleProximity(clip,
"scale", 0.9, 0.3, 0.0, 2.0, 100);
sProx.start();
clipContainer.addChild(clip);
}
pool.requestAll();
bmc.startCapture(clipContainer, false);

Hyeongjik Song

unread,
Mar 9, 2012, 4:20:49 AM3/9/12
to hypefr...@googlegroups.com
because, SimpleProximity class use mouse position of target_sprite.parent (clipContainer).
but you don't add clipContainer to anywhere. (I think this is rational. flash player may has some bug..)
so, you should fix code like

var clipContainer:Sprite = new Sprite();

-->

var clipContainer:Sprite = new Sprite();
clipContainer.visible = false;
addChild(clipContainer);
Reply all
Reply to author
Forward
0 new messages