3 Replies Latest reply on Oct 10, 2006 4:17 AM by zakour12

    Trouble with dynamic MCs

    zakour12
      Hey,

      I have a set of movie clips created with createEmptyMovieClip( ) and I've loaded an external .png image into each one of them with loadClip( ). Now the problem is getting the properties of those images. For instance, how can I get the height of the image inside the clip? When I use mc._height it returns 0 (presumably because the movie clip was created empty?). Also, is it possibly to create rollover functions for these images?
        • 1. Re: Trouble with dynamic MCs
          Mani Amuthan
          can u post the exact code which u had written so that i could help u regarding it possibly if u have loaded the image properly then the movieclip will respond to u r scripts better post code if possible
          • 3. Re: Trouble with dynamic MCs
            zakour12 Level 1
            Yeah, here it is :

            function createLeftMenu( num:Number ) {
            for( i = 0 ; i < num ; i++ ) {
            j = i + 1 ;
            var firstMenuPos = 180 ;
            var menuname = ( "menuItem" + j ) ;
            var prevmenuname = ( "menuItem" + (j-1) ) ;
            var taso = 20 + j ;
            thismenu = _root.createEmptyMovieClip( menuname, taso ) ;
            prevmenu = eval( _root + "." + prevmenuname ) ;
            myMCL.loadClip( "images/layout/menuitem.png", thismenu ) ;
            if( i == 0 ) {
            thismenu._y = firstMenuPos ; }
            else {
            thismenu._y = ( prevmenu._y + 30 ) ; }
            thismenu._x = 8 ;
            trace( thismenu._height ) ;

            }
            }

            The menu loads nicely and so on, but the trace always returns 0. Also, I'm not sure how to add the rollover functions. I know I could do this the easy way by placing the movie clips directly on the Stage and so forth, but I'd like to know if it's possible to create a dynamic menu this way. Thx for the help.