Flash CS5 and dynamic display object initialisation problem!! (added after first comment: should be “my problem” rather than “problem”)

[ added after first comment : I am adding this in the beginning for not to make a fire out of the post. Well, the problem is actually on my side and not Flash CS5. I have a movieclip whose registration point is buttom-left rather than default top-left. So when adding it to the stage with “new myClip()”, it is getting added to the stage but then it stands upward from stage origin. This at the first glance to the stage makes no sense as no one can see anything above the stage. Instead of looking into this option I dig up the whole lot of other things making me believe that the problem is with Flash CS5 visual object initialisation.

I apologize, if any of you got caught by the title.

Anyway, as far as my study went regarding this subject, I do not regret as it gave me some true insights about the SWF loading with TLF RSL issue.

Here follows the original post ]

Well, this came to me as a surprise as I was breaking down a FLA into parts and getting assets from them. This was working perfect since Flash CS4. So I was going ahead with confidence that it will work perfect in Flash CS5 too !!  But it is not the case. Seems like Flash CS5 behaves very differently while initialising the display objects.

First, lets go through the links which people have already found.

After all these readings, it seems if I use one of these methods, its safe for me to go ahead. So I tried merging the TLF engine in my FLA (the easiest of all solutions).
But that also does not help me either. Geting definition from the SWF is working but the display objects do not get rendered!!
So, I continue digging it.  This time, I wanted it to be really simple. Now my target is to just instantiate a library item in the same FLA stage. Made an FLA with a library symbol named “Box” and the class name  “BoxClip” (with “Export for Actionscript” and “Export in Frame 1” ticked). Then in the first frame I have the code
var box:BoxClip=new BoxClip();
this.addChild(box);

To my surprise nothing rendered in stage!! And no errors given. Well, then thought may be I will make a class for it and see if that makes me render my object. So going ahead I made a “BoxClip” class which extends “MovieClip”. Linked it to the library symbol and tested movie. This time too it does not render my library clip. Going forward, I added a component provided in FlashCS5. And the code is modified as below
var b:Button=new Button();
this.addChild(b);

var box:BoxClip=new BoxClip();
this.addChild(box);

This time the Button component got rendered but still my library clip does not render. Finally converted my clip to a compiled clip and tested the same thing to get the same result.
Well the last option I took is changed the FLA format to new XFL format with a hope to render my library clip, but to get the same old result.
Its not that the library symbol definition is not getting into the environment, its the rendering of the display object thats the problem. For when I trace out as below
var box:BoxClip=new BoxClip();
this.addChild(box);
trace(this,box,box.visible);
the output is as follows
[object MainTimeline] [object BoxClip] true

So the object is getting created, its visibility is true. And well its being added to the display list too. As when trying to see the numChildren, it counts the object I have created dynamically.
Lastly I thought might be stage.invalidate() will help, but that also does not help here.
Hope, this helps someone out there.
Good night.

5 thoughts on “Flash CS5 and dynamic display object initialisation problem!! (added after first comment: should be “my problem” rather than “problem”)

  1. Hey Shah Nawaz,
    thank you so much for the help.

    So it was not Flash CS5, it is me who was doing something wrong.
    Actually now I remember while making the movieclip, I put the registration point at buttom-left rather than the usual top-left. So it was not visible down from the stage origin rather putting itself just on top of the stage origin, making it hidden from visible area.

    Will update the post title, so as, new users do not get an impression Flash CS5 is making it.

    Thanks again.

  2. Howdy just wanted to give you a quick heads up. The text in your content seem to be running off the screen in Opera.
    I’m not sure if this is a format issue or something to do with browser compatibility but I figured I’d post to let you
    know. The design look great though! Hope you get the
    problem fixed soon. Many thanks

  3. Pretty portion of content. I just stumbled upon your blog and in accession capital to claim that I acquire actually enjoyed account your weblog posts. Any way I’ll be subscribing in your augment and even I fulfillment you get admission to consistently quickly.

Leave a reply to pbolist.com Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.