Показать сообщение отдельно
Старый 03.10.2013, 09:36
Fogflasher вне форума Посмотреть профиль Отправить личное сообщение для Fogflasher Найти все сообщения от Fogflasher
  № 15  
Ответить с цитированием
Fogflasher

Регистрация: Mar 2013
Сообщений: 290
Цитата:
Сообщение от Akopalipsis Посмотреть сообщение
я точно знаю, что добавлять на стейдж обьекты - нельзя!
Хм, а по Муку вроде как можно, вот например:

For example, the following code modifies the App class from Example 20-5 so that the Sprite object
and its child Shape object are added directly to the Stage instance. Because the Sprite
and Shape objects are not descendants of a .swf file’s main class instance, their root
variables refer to the Stage instance.


Код AS3:
package {
  import flash.display.*;
  import flash.geom.*;
  public class App extends Sprite {
    public function App ( ) {
      var rect:Shape = new Shape( );
      rect.graphics.lineStyle(1);
      rect.graphics.beginFill(0x0000FF, 1);
      rect.graphics.drawRect(0, 0, 75, 50);
      var sprite:Sprite = new Sprite( );
      sprite.addChild(rect);
      // Add child to Stage instance, not this App instance
      stage.addChild(sprite);
      trace(rect.root);    // Displays: [object Stage]
      trace(sprite.root);  // Displays: [object Stage]
    }
  }
}
Ну, то есть, чисто технически можно.
Но идеологически, как мы теперь знаем, это есть зло - согласно заповедям от Wolsh, например : )