Archive for the ‘actionscript’ Category

Flash Player Supports H.264 and Yahoo’s Astra

Aug
21

Flash Video has hit the big time if you haven’t already read.

Flash is able to now load and play .mp4,.m4v,.m4a,.mov and .3gp files using the same NetStream API and is HD compatible
for more info

Also Yahoo released some new components

This is an answer to the components Adobe pulled from Flash CS3 and then some.

  1. Menu
  2. Tree
  3. Charting
  4. Auto Complete
  5. TabBar (great design)

for more info

Filter Data with ArrayCollection

Jun
6

After watching a Lynda.com tutorial realized I didn’t have to do as much work to filter data.

the filterFunction is a public property of the ICollectionView witch is the class that the ArrayCollection extends from.

So this function/method is accessible to a ArrayCollection.
[as]

< ?xml version="1.0" encoding="utf-8"?>

< ![CDATA[
import mx.collections.*;

private var collectionArray:Array;
[Bindable]
private var collectionData:ArrayCollection;

private function init():void
{
collectionArray = [{first: 'Dave', last: 'Matthews'},
{first: 'Amy', last: 'Grant'},
{first: 'Bilbo', last: 'Baggins'},
{first: 'Jessica', last: 'Tandy'},
{first: 'Paris', last: 'Hilton'}];
collectionData = new ArrayCollection(collectionArray);
}

public function filter():void {

//pass my filter function to the method w/ no ()
// you must also refresh it
collectionData.filterFunction = filterFirst;
collectionData.refresh();

}
// function see's if the searchField's text is equal to the "first" object of the collectionData

//if true it show results, if false it shows nothing
private function filterFirst(item:Object):Boolean
{
return (item.first == searchField.text)

}
]]>
[/as]

Problems w/ this:

  1. I have not found a way to match with just typing in “Da” and it is case-sensitive
  2. When you type in a non-matching string it will not reset to beginning state. (I’m sleepy so maybe that’s why I can’t figure it out.)

DFWAUG – Presentation

May
20

I learned a lot from yesterday’s presentation of the Display List of Actionscript 3 (in the realm of public speaking for programming). If you missed it here are the files and presentation.

Dallas-Fort Worth Adobe Users Group Actionscript 3 presentation

Actionscript 3 Clouds

May
8

I made my own rendition to AS3:Cookbook example of Perlin Noise, an effect created for Tron believe it or not.

[as]

package {
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.events.Event;
import flash.geom.Point;
import flash.display.BitmapDataChannel;

public class Clouds extends Sprite
{
private var _bitmap:BitmapData;
private var _xoffset:int = 0;
private var _w:Number
private var _h:Number

public function Clouds(w:Number, h:Number)
{
_w = w;
_h = h;
_bitmap = new BitmapData(_w, _h, true, 0xffFFFFFF);
var image:Bitmap = new Bitmap(_bitmap);
image.x = image.y = 0;
addChild(image);
addEventListener(Event.ENTER_FRAME, onEnterFrame);

}

public function onEnterFrame(event:Event):void
{
_xoffset++;
var point:Point = new Point(_xoffset, 0);

_bitmap.perlinNoise(200, 100, 2, 1000, true, true, 8, true, [point, point]);
}
}
}

[/as]

Flash CS3 animator class and loading XML animation at runtime

May
4

So there is a new animator class. It works like FuseXML. The animations are set by nodes and attributes.
To do this:

  1. start a CS3 document
  2. make an mc called ‘abox’
  3. make an animation
  4. select the animation
  5. Commands > Export Motion XML
  6. name xml file “motion.xml”
  7. create an actionscript layer
  8. Then load XML as usual.

add:

import fl.motion.Animator;
import fl.motion.MotionEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.*;
 
var abox_xml:XML;
var requester:URLRequest = new URLRequest("motion.xml");
var loader:URLLoader = new URLLoader(requester);
var abox_animator:Animator;
loader.addEventListener(Event.COMPLETE, startAnimation);
 
function startAnimation(evt:Event):void {
 
abox_xml = XML(evt.target.data);
abox_animator = new Animator(abox_xml, abox);
abox_animator.play();
 
}

Tweened Menu

Oct
12

Mouse follow 2

Sep
1

Here is an update from the mouse follow menu. It only works when you are 100px in.

this.mcMouseFlo.onEnterFrame = function() {
if (_root._xmouse < 100) {
this._y = _root._ymouse;
if (_root._ymouse <= 60) {
this._y = 60;
}
if (_root._ymouse >= 301) {
this._y = 301;
}
}
};

Mouse follow menu

Aug
31

Hey so I’m behind on flash knowledge but did this all by myself no help from boone or anybody. It a small Movie Clip that follows the mouse under a mask. Simple but I like it. Excuse the design, I was going for function not look. Now I need to get the box to stay a bit while over the button and not follow so close.


this.mcMouseFlo.onEnterFrame = function():Void {

if (_root._xmouse < 89) {
this._y = _root._ymouse;
}

if (_root._ymouse <= 60){
this._y = 60;
}
if (_root._ymouse >= 240){
this._y = 240;
}

}

The Horror Update (required flash 8 beta)

Aug
22

.

Special thanks to boone!
if you can’t see get flash player 8 beta

My first finished 100% actionscripted flash app.

Aug
18


I am excited to show off My first finished 100% actionscripted flash app. though crude, I will massage it but I wanted to put it up. Oh it using the lates flash 8 actionscript not out to the general public. I modified it from: http://www.osflash.org/doku.php?id=flashcoders:undocumented:flash-7-export-to-flash-8

here is the code

//————–origninal from: http://www.osflash.org/doku.php?id=flashcoders:undocumented:flash-7-export-to-flash-8
// if anyone knows how I can make this reverse the blur I would appreciate it.

function blurChange():Void {
if (nTimes >= 20) {
trace(nTimes);
dropShadow.blurY = nTimes-=2;
txtField.filters = [dropShadow];
txtField.htmlText = “The Horror”;
}
else if (nTimes = 20) {
dropShadow.blurY = nTimes+=2;
txtField.filters = [dropShadow];
txtField.htmlText = “The Horror”;
//clearInterval (nInterval);
}

}

var nTimes:Number = 100;
var nInterval:Number = setInterval(blurChange, 100);

// create textfield
this.createTextField(“txtField”, this.getNextHighestDepth(), 50, 100, 500, 800);
txtField.html = true;

txtField.textColor = 0×000000;
// set new antialias mode
txtField.antiAliasType = flash.text.TextRenderer.AntiAliasType.ADVANCED;
// create shadow filter
var dropShadow = new flash.filters.DropShadowFilter();
dropShadow.blurX = 1;
dropShadow.blurY = nTimes; //var from problem
dropShadow.distance = 3;
dropShadow.angle = 35;
dropShadow.quality = 4;
dropShadow.alpha = 75;
// apply shadow filter
txtField.filters = [dropShadow];