import away3d.cameras.HoverCamera3D;
import away3d.containers.View3D;
import away3d.materials.ColorMaterial;
import away3d.primitives.Sphere;
import away3d.primitives.Trident;
import away3d.containers.View3D;
import away3d.materials.BitmapMaterial;
import away3d.core.base.Object3D;
import away3d.materials.*;
import away3d.containers.*;
import away3d.materials.BitmapMaterial;
import away3d.materials.EnviroBitmapMaterial;
import away3d.materials.EnviroColorMaterial;
import away3d.materials.PhongBitmapMaterial;
import away3d.materials.TransformBitmapMaterial;
import away3d.materials.utils.SimpleShadow;
import away3d.primitives.Plane;
import away3d.events.MouseEvent3D;
import away3d.materials.MovieMaterial;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import com.greensock.*;
import com.greensock.TweenLite;
import com.greensock.easing.*;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.MovieClip;
import flash.text.TextFieldAutoSize;
import flashx.textLayout.formats.BackgroundColor;
import flash.text.TextField;
import flash.display.Sprite;
var GMcamera:HoverCamera3D;
var lastMouseX:Number;
var lastMouseY:Number;
var lastPanAngle:Number;
var lastTiltAngle:Number;
var move:Boolean = false;
var View:View3D;
var group:ObjectContainer3D;
var GMscene:Scene3D;
var labeltitle:TextField;
var pan:Sprite;
var material_01:BitmapFileMaterial;
var material_02:BitmapFileMaterial;
var material_03:BitmapFileMaterial;
var material_04:BitmapFileMaterial;
var material_05:BitmapFileMaterial;
//var ScreenMaterial_01:MovieMaterial;
var myPlane1:Plane;
var myPlane1a:Plane;
var ScreenPlane01:Plane;
var ScreenPlane01a:Plane;
var myPlane2:Plane;
var myPlane2a:Plane;
var Planetarget:Plane;
function GM():void
{
this.stage.scaleMode = StageScaleMode.NO_SCALE;
//this.stage.align = StageAlign.CENTER;
GMscene = new Scene3D();
GMcamera = new HoverCamera3D();
View = new View3D({camera:GMcamera,x:org.x,y:org.y});
addChild(View);
GMcamera.panAngle = 20;
GMcamera.tiltAngle = 10;
//GMcamera.minTiltAngle = -90;
GMcamera.hover(true);
group = new ObjectContainer3D();
View.scene.addChild(group);
// Show the axis
var axis:Trident = new Trident(180);
View.scene.addChild(axis);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
this.stage.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
this.stage.addEventListener(MouseEvent.MOUSE_UP, MouseUp);
//this.stage.addEventListener(MouseEvent.MOUSE_UP, MouseOver);
initObjects();
addText();
}
function MouseDown(event:MouseEvent):void
{
lastPanAngle = GMcamera.panAngle;
lastTiltAngle = GMcamera.tiltAngle;
lastMouseX = stage.mouseX;
lastMouseY = stage.mouseY;
move = true;
}
function MouseUp(event:MouseEvent):void
{
move = false;
}
function MouseOver(e:MouseEvent3D):void
{
TweenLite.to(GMcamera, 0.3, { panAngle:0, tiltAngle:0, zoom:10 });
//GMcamera.target = e.target as Object3D;
}
function MouseOut(e:MouseEvent3D):void
{
TweenLite.to(GMcamera, 1, { panAngle:20, tiltAngle:10 ,zoom:8 });
}
function onEnterFrame(e:Event):void
{
goFullScreen();
//TweenLite.to(GMcamera, 0.3, { panAngle:45, tiltAngle:20, scaleX:0.5, scaleY:0.5});
// re-render viewport
var cameraSpeed:Number = 0.3; // Approximately same speed as mouse movement.
if (move) {
GMcamera.panAngle = cameraSpeed*(stage.mouseX - lastMouseX) + lastPanAngle;
GMcamera.tiltAngle = cameraSpeed*(stage.mouseY - lastMouseY) + lastTiltAngle;
}
GMcamera.hover();
View.render();
//labeltitle.text = "Zoom: "+GMcamera.panAngle;
}
function initObjects():void
{
//Material
material_01 = new BitmapFileMaterial("./images/Screen1.jpg");
myPlane1 = new Plane({material:material_01,
x:50,y:50,z:0,
height:350,width:900,
rotationX:90,rotationY:180,
name:"Timepieces"});
myPlane1.bothsides=true;
group.addChild(myPlane1);
myPlane1.addEventListener(MouseEvent3D.MOUSE_OVER, MouseOver);
myPlane1.addEventListener(MouseEvent3D.MOUSE_OUT, MouseOut);
myPlane1a.addEventListener(MouseEvent3D.MOUSE_OVER, MouseOver);
myPlane1a.addEventListener(MouseEvent3D.MOUSE_OUT, MouseOut);
}
function addText():void
{
labeltitle = new TextField();
labeltitle.autoSize = TextFieldAutoSize.LEFT;
var myFont = new verdena();
var txtFormat:TextFormat = new TextFormat();
txtFormat.font = myFont.fontName;
txtFormat.color = 0xFFFFFF;
txtFormat.size = 14;
labeltitle.defaultTextFormat = txtFormat;
labeltitle.width = 85;
labeltitle.x = 5;
labeltitle.y = 5;
pan = new Sprite();
pan.graphics.beginFill(0x000000);
pan.graphics.drawRoundRect(0,0,100,100,10,10);
pan.graphics.endFill();
addChild(pan);
pan.x = 10;
pan.y = stage.width;
pan.addChild(labeltitle);
}
function Screen1():void
{
/* ScreenMaterial_01 = new BitmapFileMaterial("screen1.swf");
var mymovieclip:MovieClip = new MovieClip();
mymovieclip.graphics.beginFill(0xFF0000);
mymovieclip.graphics.drawRect(0, 0, 500, 500);
mymovieclip.graphics.endFill();
mymovieclip.x = 80;
mymovieclip.y = 60;
group.addChild(mymovieclip);
ScreenMaterial_01=new MovieMaterial(mymovieclip);
ScreenPlane01 = new Plane({material:ScreenMaterial_01,width:500,height:500,x:50,y:50,segmentsW:1,segmentsH:1,z:0,rotationX:90,rotationY:180,name:"Timepieces"});
ScreenPlane01a = new Plane({material:material_01,x:50,y:50,z:0,rotationX:90,name:"Timepieces"});
ScreenPlane01.bothsides=true;
group.addChild(ScreenPlane01);
group.addChild(ScreenPlane01a);
var materialMovie:MovieClip = new causticsMovie() as MovieClip;
var causticsMaterial:MovieMaterial = new MovieMaterial( materialMovie );
var sphere:Sphere = new Sphere({material:causticsMaterial});
view.scene.addChild(sphere);
var mc:MovieClip = new MovieClip();
mc.graphics.beginFill(0xFF0000);
mc.graphics.drawRect(0, 0, 100, 80);
mc.graphics.endFill();
mc.x = 80;
mc.y = 60;
group.addChild(mc);*/
}
GM();
//Full Screen
import flash.display.StageDisplayState;
function goFullScreen():void
{
if (stage.displayState == StageDisplayState.NORMAL) {
stage.displayState=StageDisplayState.FULL_SCREEN;
}/* else {
stage.displayState=StageDisplayState.NORMAL;
}*/
}
import flash.system.fscommand;
var exit_btn:close_btn = new close_btn();
exit_btn.x = 450;
exit_btn.y = 743;
exit_btn.buttonMode = true;
exit_btn.addEventListener(MouseEvent.MOUSE_DOWN, _handleClick)
addChild(exit_btn);
function _handleClick(event:MouseEvent):void
{
fscommand("quit");
}
Venom the last dance animation
-
Venom the last dance animation, hope you like it
https://www.youtube.com/watch?v=HHG3A-zR7CY
1 week ago
0 comments:
Post a Comment