Показать сообщение отдельно
Старый 03.05.2014, 02:59
2misha вне форума Посмотреть профиль Отправить личное сообщение для 2misha Найти все сообщения от 2misha
  № 26  
Ответить с цитированием
2misha

Регистрация: Apr 2014
Сообщений: 97
Ой, тупанул. Ставлю в класс:
Код AS3:
package classes
{
	/**
	 * ...
	 * @author Scorpion
	 */
	import flash.events.*;
	import flash.display.*;
 
	public class Image extends Sprite 
        {
 
 
	[Embed(source="../../img/background.png")] private const Embed1:Class;
	[Embed(source = "../../img/head.png")] private const Embed2:Class;
	[Embed(source = "../../img/menuline.png")] private const Embed3:Class;
 
		public static function addImage(i1: int, i2: int, i3: int): Bitmap
		{
			switch(i3)
			{
				case 1: return new Embed1() as Bitmap;
				case 2: return new Embed2() as Bitmap;
				case 3: return new Embed3() as Bitmap;
			}
 
			var image: Class;
 
			var newImage: Bitmap = new image();
			newImage.x = i1;
			newImage.y = i2;
		}
	}
}
И епт ... снова ошибкки в строчках case 1: return new Embed1() as Bitmap;
case 2: return new Embed2() as Bitmap;
case 3: return new Embed3() as Bitmap;
а так же function does not return a value