[Embed(source = "intro.swf", mimeType = "application/octet-stream")] public var introAnimation:Class;

var loader:Loader = new Loader();
loader.loadBytes(new introAnimation as ByteArray ); 
addChild(loader);

 
 

  for(i = 0; i < document.getElementById("divContainer").childNodes.length;i++){
                        var ele = document.getElementById("divContainer").childNodes[i];
                        ele.removeNode(true);
                    }

 
 

 var js:XML;
js =
<script><![CDATA[
    function inject()
        {
            console.log("inject");
        }
    ]]></script>

ExternalInterface.call(js);

 
 

 var divContainer = document.createElement("div");
document.body.appendChild(divContainer);

 
 

 var img = document.getElementById("object");
var pai = img.parentNode;
pai.removeChild(img);      

 
 

  private var vertices:Vector.<Number>
private var indices:Vector.<int>
private var uv:Vector.<Number>

private var canvas:Sprite;
private var perspective:PerspectiveProjection;
        
private var worldMatrix:Matrix3D;
private var viewMatrix:Matrix3D;
        
private var zCam:Number = 90        

public function Main():void{
    canvas = new Sprite();
    canvas.x = stage.stageWidth >> 1;
    canvas.y = stage.stageHeight >> 1;
    addChild(canvas);
    
    vertices = new Vector.<Number>()
    uv = new Vector.<Number>()
    indices = new Vector.<int>()
            
    vertices.push( -50, -50, 0 );
    vertices.push( +50, -50, 0 );
    vertices.push( -50, +50, 0 );
    vertices.push( +50, +50, 0 );
            
    indices.push(0, 2, 1, 1, 2, 3);
        
    worldMatrix = new Matrix3D()
    worldMatrix.appendRotation(45, Vector3D.X_AXIS);
    viewMatrix = new Matrix3D()
            
    perspective = new PerspectiveProjection()
    perspective.fieldOfView = 60
            
    addEventListener(Event.ENTER_FRAME, enterFrameHandler)
            
        
}
        
private function enterFrameHandler(e:Event):void {
            
    viewMatrix = new Matrix3D()
    viewMatrix.appendTranslation(0, 0, 90)
            
        
    var m:Matrix3D = new Matrix3D()
    m.append(worldMatrix)
    m.append(viewMatrix)
    m.append(perspective.toMatrix3D())
            
    var projected:Vector.<Number> = new Vector.<Number>()
    Utils3D.projectVectors(m, vertices, projected, uv)
        
    
    canvas.graphics.clear();
    canvas.graphics.lineStyle(1, 0x000fff)
    canvas.graphics.beginFill(0x000000)        
    canvas.graphics.drawTriangles(projected, indices, null, "none")
    canvas.graphics.endFill()        
    canvas.alpha = 0.5;
                
}           

 
 

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head> </head>
<body> </body>
</html>

 
 

 import flash.display.LoaderInfo
var obj:Object = Object(LoaderInfo(this.root.loaderInfo).parameters)
var varName:String;
for (varName in obj) {
     var flashVars:String = obj[varName]
}

 
 

 Loader.*
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function completeHandler(e:Event):void{
      var mc:MovieClip = MovieClip(loader.content);
      mc._root = root;
})
loader.load(new UrlRequest("Wrapper.swf"))

Wrapper.*
public var _root:Object;
private function click(e:MouseEvent):void{
      _root.click()
}

 
 

 <object type="application/x-shockwave-flash" data="ExternalInterfaceExample.swf?path=movie.swf" id="ExternalInterfaceExample" width="400" height="300">
        <param name="movie" value="ExternalInterfaceExample.swf" />
    </object>    

 
 

  (function(window){

    //public variables
    Car.prototype.mpg = 30;
    
    //static variable
    Car.num_of_wheels = 4;
    
    function Car(make, model, color){
        //private variables
        var _make = make;
        var _model = model;
        var _color = color;
        
        this.getMake = function(){
            return _make;
        }
        this.getModel = function(){
            return _model;
        }
    }
    Car.prototype.startEngine = function(){
        console.log(getDesc(this) + "engine stated");
    }
    function getDesc(context){
        return context.getMake() + " " + context.getModel();
    }
    window.Car = Car;
}(window));
var car = new Car("citroen","c3","black")

 
 

  (stage.getChildByName("mc") == null ? trace("nulo") : trace("não nulo"))