Still weirding me out. To me part of the appeal of working with movieclips is their inherent hierarchy, which makes a kind of basic sense that's easy to grasp. This new method seems to place "more" control in the hands of the developer, but at the same time complicating what has always been a really simple mechanism. At the very least i'd expect the MovieClip constructor to accept an arg for its parent or somesuch so as to simplify the method.

I'm guessing part of why we're waiting til Flash 9 for this stuff is because it doesn't make immediate sense in a Flash IDE context yet. Makes a world of sense in a forms context, but with my way of working
it almost seems counterintuitive. Probably just developer paranoia though :)
I can imagine Flash 9 will look quite different to 8ball..

- Andreas

Frédéric v. Bochmann wrote:

This example makes me wonder:

If I was to write this in AS2, it would probably look like:

....
class Game extends MovieClip {
public function Game(){
        var gameworld:MovieClip = new
createEmptyMovieClip("gameworld_mc",getNextHighestDepth()); //new
GameWorld()?
        
        var game_bg:MovieClip = gameworld.createEmptyMovieClip("game_bg_mc",
gameworld.getNextHighestDepth());

}

I wouldn't have access to addChild in AS2, how does that addChild actually
work in AS3? Are Child movieclips that are added still independent?
For example, if I was to add two time the Background movieclip to the
gameworld movieclip in AS3.
Take for example:
...
var game_bg:MovieClip = new MovieClip();
gameworld.addChild( game_bg );
gameworld.addChild( game_bg );
...

What would happen if I affected game_bg _width or _height?
How does this go?

Just curious :)




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Shaw, Matt
Sent: October 28, 2005 1:55 PM
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Newbie AS3 question

Assuming the Game class is your root/stage class:

....
Public class Game extends MovieClip {
public function Game(){
        var gameworld:MovieClip = new MovieClip(); //new GameWorld()?
        this.addChild( gameworld );

        var game_bg:MovieClip = new MovieClip();
        gameworld.addChild( game_bg );
}



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andreas
Rønning
Sent: Friday, October 28, 2005 1:08 PM
To: Flashcoders mailing list
Subject: [Flashcoders] Newbie AS3 question

AS3 noob question ahoy!

I'm reading the AS3 reference trying to get accustomed to the idea, but some
things (though they look better) i don't really get right away :) Hence my
feeling of incredible stupidity.

I realise the AS3 in the reference is Flex-related, but in Flash IDE terms,
how would i do something like this in AS3:

var baseClip = _root.createEmptyMovieClip("gameworld",1);
var backGround = baseClip.createEmptyMovieClip("game_bg",1);

I get how much more practical myClip = new MovieClip(); looks, but i don't
get how i connect a clip created this way with the traditional clip
hierarchy. Is that out the window as well?
The reference describes |DisplayObjectContainer.addChild(), but i'm guessing
this doesnt really count for how it'll work in the Flash IDE?

Any helpful hints at what the future holds? :)
|
- Andreas
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to