Flash AS3 | Get Actual Width and Hight of Rotated Object

//get the rotation of object
var objRotation:Number = objBox.rotation;

//check if it rotate
if(objRotation != 0)
{
//rotate it to Zero
objBox.rotation = 0;
}

//get width and height
thisWidth = objBox.width;
thisHeight = objBox.height;

//rotate
objBox.rotation = objRotation

p1

Flash AS3 | Get Width and Height of Rotated Object

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

p1

Apache | Virtual Host Configuration

1- Enable Virtual Host in Apache httpd.conf
Start->Programs->Apache HTTP Server->Configure Apache Server->Edit the Apache httpd.conf Configuration File

or goto httpd.conf folder of Apache Installed Folder

Find this #Include conf/extra/httpd-vhosts.conf (Ctrl + F, type this, Enter)

Then remove # from the line

so it should be

Include conf/extra/httpd-vhosts.conf

2- Folder Security

Still in httpd.conf

Find where similar of this code are:
then put this element after existed one:


[Directory "C:\ My Sites "]
Order Deny,Allow
Allow from all
[/Directory]

Note: c:\My sites is the path of your website

3- Create Virtual Host in httpd-vhosts.conf
open httpd-vhosts.conf then put this element at the bottom

[VirtualHost 127.0.0.1]
DocumentRoot "C:\My Sites\Site1"
ServerName site1.local
[/VirtualHost]

4- Resolving the DNS issue
goto

C:\WINNT\system32\drivers\etc\hosts

or

C:\Windows\system32\drivers\etc\hosts


Put this code in

127.0.0.1 site1.local

Finally restart apache

p1

AS3 Retrieve Flash Vars & HTML put Flash (swfObject)

Retrieve Flash Vars
---------------------
var fileName:String = new String();
fileName = root.loaderInfo.parameters.fileName
HTML (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 type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var flashvars = {
cicadaUrl:'http://cicadagroup.com.au/index.php?categoryid=1',
fireflyUrl:' ',
chocolateSoldierUrl:' ',
greengrocerUrl:' ',
contactusUrl:' ',
locationUrl:' ',
employmentUrl:' '
};
var params = {
menu: "false"
};

swfobject.embedSWF("LandingPage2.swf", "myContent", "980", "600", "9.0.0","expressInstall.swf", flashvars, params);

</script>

</head>

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/2;

p1

Flash AS3 | Change color of movieclip with TINT

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

p1

Flash AS3 | Load External Images in Flash vr. 2

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 onCompleteHandler(loadEvent:Event)
{
addChild(loadEvent.currentTarget.content);
}
function onProgressHandler(mProgress:ProgressEvent)
{
var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
trace(percent);
}
startLoad();

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