Posts by savorks

111 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
savorks says
as3
var array:Array = [], result:Array = [];

while(array.length <= 42) 
    array.push(array.length);

while(result.length < 6) 
    result = result.concat(array.splice(int(Math.random()*array.length), 1));

trace(result);

like this?

111 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
savorks says
this ?
fscommand("fullscreen", "true");
111 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
savorks says
try this ?
var BitmapDataClass:Class = Class(array[i]);
var bitmapData:BitmapData = new BitmapDataClass(0,0);
var bitmap:Bitmap = new Bitmap(bitmapData);
addChild(bitmap);
111 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
savorks says

The idea was make a fake shape which have same 2D geom information with your source bitmap (can use transform.pixelBounds get the bound), put it into same display list as your source, and apply source’s Matrix3D (in case it is dirty already) to the fake shape.

After this, you can apply 3D transform like rotationX on the fake shape and get its 2D information like height, before you apply the transform to your source.

notice when DisplayObject in different display list, if it’s Matrix3D is dirty already, you will get different height/width information because it will effect by ancestor.

111 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
savorks says

This is stupid way, kinda waste CPU , and only work with rectangle shape DisplayObjects…... but if you really need get bound before apply 3D transform to your target DisplayObject…

var source:Bitmap;
// ... scripts for build source

var sourceBound:Rectangle = source.getBounds(source);
var shape:Shape = new Shape();
var g:Graphics = shape.graphics;
g.beginFill(0);
g.drawRect(sourceBound.x, sourceBound.y, sourceBound.width, sourceBound.height);
g.endFill();

shape.transform.matrix3D = source.transform.matrix3D.clone();
shape.rotationX = 30;

if (shape.height > someValue)
{
    source.transform.matrix3D = shape.transform.matrix3D.clone();
}
111 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
savorks says

it is better generate id on server side, in php, consider use uniqid(); :)

(or you can generate id by time)

111 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
savorks says


alphaLayer should contains graphics witch Alpha infomation.

here is a example
Example
Source

I see. I’ll redo it to my project. You were really helpful, thank you!

It is my pleasure :)

111 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
savorks says

alphaLayer should contains graphics witch Alpha infomation.

here is a example
Example
Source

EDIT : you can apply filters to alphaLayer’s children (don’t apply to alphaLayer self)
Example with Filters

111 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
savorks says
var container:Sprite = new Sprite();

var alphaLayer:Sprite = new Sprite();
var maskLayer:Sprite = new Sprite();
var content:Sprite = new Sprite();

container.addChild(content);
container.addChild(maskLayer);
container.addChild(alphaLayer); // add in last for make sure it above content

content.mask = maskLayer;

addChild(container);
alphaLayer.blendMode = BlendMode.ALPHA// or BlendMode.ERASE (invert version);
container.blendMode = BlendMode.LAYER;

You can do it in timeline, the display objects setup is same with this.
alphaLayer only render with DisplayObjects under it in same parent container, so remember put it above the contents you with to render with fade effect.
In BlendMode.ALPHA mode the alphaLayer’s AlphaChannel will override target contents AlphaChannel, and BlendMode.ERASE will do just the opposite:)

111 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
savorks says

Glad you solved it now :)


I’m not sure what you mean by “state change”.

What I mean was something like this Example

Bottom clip contains Top clip and its text flash when MOUSE _OVER trigger on Bottom clip, and the Top clip have two different states (change by MOUSE _DOWN on Top clip), and you can see Bottom fire MOUSE _OVER event when MOUSE _DOWN on Top clip.

by
by
by
by
by
by