TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

attachMovie()

Page: 1 Reply
Dec 20th 2003#134335 Report
Member since: Dec 24th 2001
Posts: 222
when I use the attach movie command, can I not place properties in the fourth, optional, field. for example:

_root.attachMovie("Test","Test[1]",1,{_width: 100, _height: 100});

because when i try that it sets the width and height to zero for my clip......there are many other ways of defining these properties but if theres a way to do it like this it'd really symplify my task so any help will be appreciated......also when assigning properties through the attachMovie method can i assign values with variables? such as {_width: MyWidth, _height: MyHeight} ?
thanks.
Reply with Quote Reply
Dec 21st 2003#134376 Report
Member since: Dec 24th 2001
Posts: 222
why doesn't this work? :


/* Constants Section */
var NumBlocks = 10;
var NumRows = 4;
var StageWidth = Stage.width;
var StageHeight = Stage.height;
var BlockWidth = StageWidth/NumBlocks;
var BlockHeight = StageHeight/10;
var BlockName = " ";
/* End Constants Section */
_root.attachMovie("Block","Block1Row1",1,{ _width: BlockWidth, _height: BlockHeight,
_x: 0, _y: 0} );
for (RowCount = 1; RowCount <= NumRows; RowCount += 1) {
for (BlockCount = 2; BlockCount <= NumBlocks; BlockCount += 1) {
BlockName = "Block"+BlockCount+"Row"+RowCount;
duplicateMovieClip(_root.Block1Row1,BlockName,1);
with (_root.BlockName) {
_x = BlockWidth * BlockCount;
_y = BlockHeight * RowCount;
}
}
}
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum