23Sep

Bitmap Data CopyChannel Method

No comments

Transfers data from one channel of another BitmapData object or the current BitmapData object into a channel of the current BitmapData object.

package
{
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;

public class CopyChannel extends Sprite
{
public function CopyChannel()
{
var bmd:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, false, 0×336699);
var rect:Rectangle = new Rectangle(0, 0, 200, 200);
var pt:Point [...]

Categories: Actionscript 3
22Sep

Events from Text Links in a Textfield

No comments

I wanted to know if I had the ability to call a function from within Flash from a text link inside a text field. I was able to find a solution with from the TextEvent class.


With this basic demo if you click either Test 1, Test 2, .., Test 5 [...]

Categories: Actionscript 3
05Sep

Getting stageWidth and stageHeight

No comments

To expand on yesterday’s post, I added a few more lines of code to demonstrate how to retrieve the stage’s dimensions with the stage.stageWidth and stage.stageHeight methods.. You can see the edits in the SubClass.as file.


The Main.as file:

package {
import flash.display.Sprite;
import flash.display.Stage;
import flash.display.DisplayObject;
import fl.controls.TextArea;
import fl.controls.ScrollPolicy;

public class Main extends Sprite
{
// claim the stage
public [...]

Categories: Actionscript 3
04Sep

Target the Main Document Class from an object not on the Active Display List

No comments

So I ran into an issue where I needed to call a function within the Document Class file from another file that did not reside within the active display list. If the object is on the active display list you can simply use:
DocumentClassName(root).function();
But since the object is no on the active display list please check [...]

Categories: Actionscript 3
02Sep

Preloading Multiple Image - Demo

1 comment so far

First, sorry. Awhile back I posted my code to preload multiple images that can be found here:
http://manewc.com/2008/05/16/preloading-multiple-images-with-actionscript/
I had a request to demo how the code works, so as I looked through the code I realized that one of the arrays should have been displayed as public instead of private to make the code more reusable. [...]