Export bitmap from MovieClip (DisplayObject)

public function createPreview(obj:*):BitmapData { var resultShirt:BitmapData = new BitmapData(obj.width, obj.height, false, 0xffffff); var m:Matrix = new Matrix(); var s:Number = resultShirt.height / obj.width; obj.mask = null; m.translate(-obj.width / 2, -obj.height / 2); m.translate(resultShirt.width /

p1

Basic: Papervision3D , Plane and Movieclip Meterail

This is my first Papervision3D. I am starting to learn papervision3d. Download the source if you want to start with Papervision3D:Uh! sorry Blogger not allow to upload . so please let view the very summary code as below:package{ import flash.display.Bitmap; import flash.display.GradientType; import flash.display.Graphics; import flash.display.MovieClip; import flash.display.Sprite;

p1

AS3: Short statements

Call functionthis[shapes[currentShape]]();Meaning:shapes is array of function.exp: shapes[currentShape] = "drawingLine"so it mean drawingLine();Object Namethis['ship' + i]Meaning:this is current object. there object named ship1, ship2, ship3, ship4so in for loop, when i = 2 , it means calling to object shi

p1

Width and Hieght of Rectangle that fill the Area of inner oval

I don't have the detail formula. I just get the answer by experiment drawing Oval and Rectangle. I measure the width of oval and width of rectangle, then I got the answer as below:wRec = wCir / 1.41hRec = hCir / 1.41It is useful when we want to add the textbox area to an oval without make text show out of the ov

p1

View Simulate Download

I think this is useful if we want to test project with preloader. I may want to see how preloader work.In Flash Authoring Tool- Press Ctrl + Enter or Click on Menu Control -> Test Movie.- Once in Test Movie mode, you can watch a simulated download by enabling the Bandwidth Profiler , by Click on Test Movie Window: View -> Bandwidth Profiler- Then click on View -> Simulate Download- You can

p1

AS3 Multiple Field Array - Sort On

var records:Array = new Array();records.push({name:"john", city:"omaha", zip:68144});records.push({name:"john", city:"kansas city", zip:72345});records.push({name:"bob", city:"omaha", zip:94010});for(var i:uint = 0; i < records.length; i++) { trace(records[i].name + ", " + records[i].city);}// Results:// john, omaha// john, kansas city// bob, omahatrace("records.sortOn('name', 'city');");records.sortOn(["name",

p1

AS3 DataGrid getItemAt Example

var rowCount:Number = dg.length; trace("[AddUserForm] RowCount is " + rowCount); selectedItemStr = "" for (var i:Number = 0 ; i < rowCount ; i++) { var obj:Object = dg.getItemAt(i); if (obj.checked == "true" || obj.checked == true) { selectedItemStr += ""; //for now working only

p1

AS3: Load fresh XML without Caching.

I found the problem, and I try to found on the internet. Some poster commanded using this:var Randomstr:String = '?somvarname='+random(100);I don't know, but it does not for me. so I use this instead of:var iRequestXML:URLRequest = new URLRequest("images/" + editData); var iLoaderXML:URLLoader = new URLLoader; var iVaXML:URLVariables = new URLVariables; iVaXML.noCach

p1

Focus Event

addEventListener(FocusEvent.FOCUS_IN, showHighLight); addEventListener(FocusEvent.FOCUS_OUT, hideHighLigh

p1

AS3: Clone or Duplicate Movie

private function cloneDpObj(target:DisplayObject):DisplayObject { // create duplicate var targetClass:Class = Object(target).constructor; trace("targetClass::" + targetClass); var duplicate:DisplayObject = new targetClass(); // duplicate properties duplicate.transform = target.transform; duplicate.filters

p1

AS3 : Basic FLV Player

More resource may check here: http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/media/Video.htmlhttp://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/net/NetConnection.htmlAS3 Simple: package { import flash.display.Sprite; import flash.display.MovieClip; import flash.net.NetConnection; import flash.net.NetStream; import flash.media.Video;

p1

Import Animated Gif to Frame in Photoshop

Make sure QuickTime 7 or later is installed on your computer.It is most likely installed during Adobe Photoshop or Adobe CS3 setup but can also be downloaded and installed from Apple web site.From the File menu, open Import submenu and select Video Frames to Layers… command.The Load dialog box shows up. (This will take more than two seconds the first time but appears immediately afterwards.)Navigate

p1

as3 : Get full homepage url

eg: http://localhost:8080function getHomeURL():String{ var homeURL:String; var port:String = ExternalInterface.call('window.location.port.toString'); var hostname:String = ExternalInterface.call('window.location.hostname.toString'); if(port && port!="") { port = ":" + port; } try { homeURL = ExternalInterface.call('window.location.protocol.toString')

p1

Animatin Article

http://minyos.its.rmit.edu.au/aim/a_notes/anim_contents.h

p1

Walk Animation

http://www.idleworm.com/how/anm/02w/walk1.sh

p1

My First AIR App : Facebook Avatar Maker

Facebook Avatar Maker.Click on browse you photo, then your photo appear on app under frame, drag or zoom it to match your need, then click save, don't forget put the (.jpg) after your file name.Next version:- Add more frame style like: Drop water, Heart sign, and moreDownload and Install:- you will need Adobe Air Player to install this app, please get it from http://get.adobe.com/air/ [15.12MB] -

p1

jailbreak iphone/ipod touch 3G MC Model

This is just my note:1- Download BlackRa1n from Blackweather.com or google it2- Download iTune any version and install it on PC.3- Double-click on BlackRa1n , app start, click on make it rain, then wait few second, on screen of ur iphone show BlackRa1n.4- then if you lucky you can see BlackRa1n icon on your iphone, Make sure you connect to internet with WiFi5- touch on BlackRa1n icon to run it. if

p1

Remove some string from string

theContent = theContent.split(“damn”).join(“darn

p1

PHP Send Copy Mail

Is it possible (I'm sure it must be) for a copy of the same email to be sent to the person who has just filled in the form? $headers .= "Cc: $email\r\n"; Not a big deal, but if you want to hide the fact the email was copied to someone else, you can do the following: $headers .= "Bcc: $email\r\n"; copy from Habtom 's post

p1

Control a flash animation inside a Flex application

http://www.riacodes.com/flex/control-flash-animation-inside-a-flex-applicati

p1

Get Bitmap Data and resize movieclip

var resultShirt:BitmapData = new BitmapData(toWidth, toHeight); var copyMatrix:Matrix = new Matrix; copyMatrix.scale(toWidth/530, toHeight/300); resultShirt.draw(shirtObj, copyMatrix); return resultShi

p1

Mootool | Native Array Sum Value in Elements

calculatedTotalCost: function (subTotals) { var x = {subValue: 0}; subTotals.each(function(el, i) { if(el.value) { this.subValue+= el.value; } }.bind(x)); var updateTotalCost = x.subValue; this.totalCost.set('text', this.formatCurrency(updateTotalCost.toFixed(2))); this.totalCost.set('value', updateTotalCost);

p1

Identify Font

http://www.identifont.

p1

AS3 | Call Javascript Function

import flash.external.ExternalInterface;...ExternalInterface.call("your_javascript_function()

p1

AS3 | Stage no scale

stage.scaleMode = StageScaleMode.NO_SCA

p1

Flash AS3 | Why buttonMode not working

Child as Dynamic TextField on the top.mySprite.buttonMode = true;//By default useHandCursor is true;//mySprite.useHandCursor = true;mySprite.mouseChildren = fal

p1

AS3 Convert MovieClip or Display to BitmapData

var shirtImage:BitmapData = new BitmapData(530, 300); shirtImage.draw(shirtObj); var imagePreview:MovieClip = new MovieClip(); imagePreview.graphics.beginBitmapFill(shirtImage); imagePreview.graphics.drawRect(0, 0, 530, 300); imagePreview.graphics.endFill(); var disableMC:MovieClip = new MovieClip();

p1

AS3 | Crop image

var cropedImage:BitmapData = new BitmapData(positionImage.width, positionImage.height); var matrix:Matrix = new Matrix; var matrixXY:Point = new Point(); var smooth:Boolean = false; var bounds1 = positionImageMasking.getRect(this); var bounds2 = positionImage.getRect(this); matrixXY.x = (bounds1.x - bounds2.x)/positionImageMasking.scaleX;

p1

Flash AS3 | Proportion Width and ScaleX

myMovieClip_MC.width = 300;myMovieClip_MC.scaleY = myMovieClip_MC.scal

p1

Wamp & Another Package PHP | Virtual Host

http://foundationphp.com/tutorials/apache22_vhosts.

p1

PHP | Config with Apache 2.2

Download PHP here http://windows.php.net/download/http://www.thesitewizard.com/php/install-php-5-apache-windows.sh

p1

Flash AS3 | Open local Image

import flash.net.FileReference;public function LocalFileAccessExample():void {var fileRef = new FileReference();fileRef.addEventListener( Event.SELECT, onFileSelect );fileRef.addEventListener( Event.OPEN, onFileOpen );fileRef.browse();}private function onFileSelect( event:Event ):void {var fileRef:FileReference = event.target as FileReference;fileRef.open();}//--------------------- option with filtervar

p1

Flash AS3 | Remove all child from display object

while( layer2.numChildren > 0 ) layer2.removeChildAt( 0 );

p1

Flash AS3 | Get Actual Width and Hight of Rotated Object

//get the rotation of objectvar objRotation:Number = objBox.rotation;//check if it rotateif(objRotation != 0){ //rotate it to Zero objBox.rotation = 0;}//get width and heightthisWidth = objBox.width;thisHeight = objBox.height;//rotateobjBox.rotation = objRotat

p1

Flash AS3 | Get Width and Height of Rotated Object

var referenceRect = rotatedObject.getRect(this);referenceRect.wi

p1

Apache | Virtual Host Configuration

1- Enable Virtual Host in Apache httpd.confStart->Programs->Apache HTTP Server->Configure Apache Server->Edit the Apache httpd.conf Configuration Fileor goto httpd.conf folder of Apache Installed FolderFind this #Include conf/extra/httpd-vhosts.conf (Ctrl + F, type this, Enter)Then remove # from the lineso it should beInclude conf/extra/httpd-vhosts.conf2- Folder SecurityStill in httpd.confFind

p1

AS3 Retrieve Flash Vars & HTML put Flash (swfObject)

Retrieve Flash Vars---------------------var fileName:String = new String();fileName = root.loaderInfo.parameters.fileNameHTML (swfObject) Flash Vars------------------------------Use swfObject can be download here http://code.google.com/p/swfobject/downloads/list<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>LandingPage2</title> <script

p1

Flash AS3 | XML return value with the name of node

bookInput.Book.(author == "Stephen E. Ambrose

p1

Flash AS3 | Draw Squar

var square:Sprite = new Sprite();addChild(square);square.graphics.lineStyle(3,0x00ff00);square.graphics.beginFill(0x0000FF);square.graphics.drawRect(0,0,100,100);square.graphics.endFill();square.x = stage.stageWidth/2-square.width/2;square.y = stage.stageHeight/2-square.height

p1

Flash AS3 | Change color of movieclip with TINT

import fl.motion.Color; //create a Color object var c:Color=new Color(); //set the color of the tint and set the multiplier c.setTint(0xff0000, 0.8); //apply the tint to the colorTransform property of //the desired MovieClip/DisplayObject mc.transform.colorTransform=c; //mc is a MovieClip

p1

Flash AS3 | Load External Images in Flash vr.

import flash.net.URLRequest;import flash.display.Loader;import flash.events.Event;import flash.events.ProgressEvent;function startLoad(){var mLoader:Loader = new Loader();var mRequest:URLRequest = new URLRequest(“MouseActions.swf”);mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);mLoader.load(mRequest);}function

p1

Flash AS3 | Loading External Images in Flash

var imgLoader:Loader = new Loader();imgLoader.contentLoaderInfo.addEventListner(Event.COMPLETE,loaderCompleteHandler);function loaderCompleteHandler(e:Event):void{ trace('Image has loaded.'); addChild(imgLoader);}imgLoader.load(new URLRequest('image.jpg'

p1

AS3 Flash | Give result to XML variable

function LoadXML(e:Event):void { xmlData = new XML(e.target.data); ParseBooks(xmlData);} function ParseBooks(bookInput:XML):void { trace("XML Output"); trace("------------------------"); trace(bookInput

p1

AS3 Flash | Load External XML with urlLoader

var xmlLoader:URLLoader = new URLLoader(); var xmlData:XML = new XML(); xmlLoader.addEventListener(Event.COMPLETE, LoadXML); xmlLoader.load(new URLRequest("http://www.kirupa.com/net/files/sampleXML.xml")); function LoadXML(e:Event):void { xmlData = new XML(e.target.data); trace(xmlData

p1

AS3 Flash | Load External XML with urlLoader

AS3===var xmlLoader:URLLoader = new URLLoader();xmlLoader.addEventListener(Event.COMPLETE, showXML);xmlLoader.load(new URLRequest("playlistAS3.xml"));funciton========function showXML(e:Event):void {XML.ignoreWhitespace = true;var songs:XML = new XML(e.target.data);trace(songs.track.length());var i:Number;for (i=0; i < songs.track.length(); i++) {trace(" Name of the song: "+ songs.track[i].title.text());trace("

p1

AS3 Flash | Dispatchevent

import flash.events.Event;dispatchEvent(new Event("closedPopUp"

p1

AS3 Flash | Automatically Action using Timer Class

var timer:Timer = new Timer(1000, 2); timer.addEventListener(TimerEvent.TIMER, blah); timer.start(); function blah(e:TimerEvent):void{ trace("Times Fired: " + e.currentTarget.currentCount); trace("Time Delayed: " + e.currentTarget.delay);}to be conti

p1

AS3 Flash | Coding Object have shadow effect

var logo:FlashEssential = new FlashEssential();var dropShadow:DropShadowFilter = new DropShadowFilter();logo.filters = [dropShadow]; dropShadow.distance = 1;dropShadow.alpha = .2;dropShadow.blurX = 10;dropShadow.blurY = 10;addChild(logo);(correct it lat

p1

AS3 | Array

Create Arrayvar myArray:Array = new Array("A", "B", "C");Using element of an Arraytrace(myArray[2]);output is: CAdding element to array1- myArray[3] = "D"; // create element at 3th site of the array2- myArray.push("D"); //create element after the last site of the arrayChanging element of the arraymyArray[3] = "Changed D"(to be contin

p1

AS3 Flash | Dynamic Textfield autoSize

This will make the Dynamic Text auto resizing to fit long of text.Once create dynamic text. set Behavior to Single lineWhen you set the text to this text field, you just code like this : menuTextNormal.autoSize = TextFieldAutoSize.LEFT; menuTextNormal.text = _menuText;That's do

p1