A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] Movieclips in a movieclip

  1. #1
    Junior Member
    Join Date
    Oct 2007
    Posts
    3

    resolved [RESOLVED] Movieclips in a movieclip

    Hey Guys,

    I'm struggeling with a problem. I want to create new movieclips when i start my Flash application and then controlling these movieclips all at once. For example they have to be scrollable.

    My code is now like this, and I'm kinda stuck:

    Code:
    var depth:Number = 0;
    var xOffset:Number = 30;
    var yOffset:Number = 60;
    var arr:Array = new Array();
    var ww_arr:Array = new Array();
    
    createTxt = function(){
    	for(var i=0; i<arr.length; i++){
    		mc = attachMovie("item", "item_"+i, depth++);
    		mc.item_txt.text = arr[i];
    		mc.item_txt.setTextFormat(txt_fmt);
    		mc._x = xOffset;
    		mc._y = yOffset;
    		mc.autoSize = true;
    		mc._visible = false;
    		yOffset = yOffset + mc._height;
    	}
    	yOffset = 60;
    	for(var i=0; i<ww_arr.length; i++){
    		mc = attachMovie("item", "sec_item_"+i, depth++);
    		mc.item_txt.text = ww_arr[i];
    		mc.item_txt.setTextFormat(txt_fmt);
    		mc._x = xOffset + 100;
    		mc._y = yOffset;
    		mc.autoSize = true;
    		mc._visible = false;
    		yOffset = yOffset + mc._height;
    	}
    }
    How can I controle these two columns at once? I tought of maybe putting them in the same movieclip. But how can I do that?

    thnx

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    I dont even see anything that has to do with scrolling/scrollBar?? am I missing something?

    here is attaching them both inside another clip:

    Code:
    createTxt = function(){
    	this.createEmptyMovieClip("textContainer", this.getNextHighestDepth());
    	for(var i=0; i<arr.length; i++){
    		mc = textContainer.attachMovie("item", "item_"+i, depth++);
    		mc.item_txt.text = arr[i];
    		mc.item_txt.setTextFormat(txt_fmt);
    		mc._x = xOffset;
    		mc._y = yOffset;
    		mc.autoSize = true;
    		mc._visible = false;
    		yOffset = yOffset + mc._height;
    	}
    	yOffset = 60;
    	for(var i=0; i<ww_arr.length; i++){
    		mc = textContainer.attachMovie("item", "sec_item_"+i, depth++);
    		mc.item_txt.text = ww_arr[i];
    		mc.item_txt.setTextFormat(txt_fmt);
    		mc._x = xOffset + 100;
    		mc._y = yOffset;
    		mc.autoSize = true;
    		mc._visible = false;
    		yOffset = yOffset + mc._height;
    	}
    }

  3. #3
    Junior Member
    Join Date
    Oct 2007
    Posts
    3
    Hey thanks! for your help! I just couldn't figure out how to solve this problem.
    No, I didn't post de rest of the code for de scrollbar/scrollbuttons.

    But thanks again for your quick help: it works!!!

    Greetz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center