Показать сообщение отдельно
Старый 16.11.2012, 12:30
billion вне форума Посмотреть профиль Отправить личное сообщение для billion Посетить домашнюю страницу billion Найти все сообщения от billion
  № 11  
Ответить с цитированием
billion

Регистрация: Jan 2002
Сообщений: 149
Отправить сообщение для billion с помощью ICQ
никак не могу прикрутить away к Flash Builder.... пустой экран получается.... подскажите плиз что делаю не так?

Код AS3:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
			   creationComplete="application1_creationCompleteHandler(event)">
 
	<mx:UIComponent id="ui" width="100%" height="100%"/>
 
	<s:BorderContainer width="100%" height="100%">
		<s:SpriteVisualElement id="sv" width="100%" height="100%"/>
	</s:BorderContainer>
 
	<s:TextArea id="txt" width="200" height="100" left="0" verticalCenter="0"/>
 
	<fx:Script>
		<![CDATA[
			import mx.events.FlexEvent;
 
			protected function application1_creationCompleteHandler(event:FlexEvent):void
			{
				var ss:Basic_View = new Basic_View();
				sv.addChild(ss);
			}
 
		]]>
	</fx:Script>
 
 
 
</s:Application>
Код AS3:
package 
{
	import away3d.containers.*;
	import away3d.entities.*;
	import away3d.materials.*;
	import away3d.primitives.*;
	import away3d.utils.*;
 
	import flash.display.*;
	import flash.events.*;
	import flash.geom.Vector3D;
 
	[SWF(backgroundColor="#000000", frameRate="60")]
 
	public class Basic_View extends Sprite
	{
		//plane texture
		[Embed(source="/embeds/floor_diffuse.jpg")]
		public static var FloorDiffuse:Class;
 
		//engine variables
		private var _view:View3D;
 
		//scene objects
		private var _plane:Mesh;
 
		/**
		 * Constructor
		 */
		public function Basic_View()
		{
			addEventListener(Event.ADDED_TO_STAGE, init);
		}
 
		private function init(event:Event=null):void {
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
 
			//setup the view
			_view = new View3D();
			addChild(_view);
 
			//setup the camera
			_view.camera.z = -600;
			_view.camera.y = 500;
			_view.camera.lookAt(new Vector3D());
 
			//setup the scene
			_plane = new Mesh(new PlaneGeometry(700, 700), new TextureMaterial(Cast.bitmapTexture(FloorDiffuse)));
			_view.scene.addChild(_plane);
 
			//setup the render loop
			addEventListener(Event.ENTER_FRAME, _onEnterFrame);
			stage.addEventListener(Event.RESIZE, onResize);
			onResize();
		}
 
		/**
		 * render loop
		 */
		private function _onEnterFrame(e:Event):void
		{
			_plane.rotationY += 1;
 
			_view.render();
		}
 
		/**
		 * stage listener for resize events
		 */
		private function onResize(event:Event = null):void
		{
			_view.width = stage.stageWidth;
			_view.height = stage.stageHeight;
		}
	}
}
Добавлено через 21 минуту
хмм... прикрутил к флэшу - работает. а в билдере ни в какую