Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411858 Posts in 69423 Topics- by 58469 Members - Latest Member: AuroraMaster

June 03, 2024, 12:08:19 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)AS3 Dynamic MovieClip HELP PLZ.......
Pages: [1]
Print
Author Topic: AS3 Dynamic MovieClip HELP PLZ.......  (Read 1342 times)
Sigma
Level 1
*


View Profile WWW
« on: October 21, 2009, 10:17:07 PM »

Hi Guys,
       how to create a movieclip content dynamically. say for example i have a movieclip with a single tile. At runtime i have to create a movieclip with n(variable) number of tiles. suppose a number given is 5 then the newly created movieclip should contain 5 copies
of the movieclip(which has tile) in a horizontal or vertical order.
« Last Edit: October 24, 2009, 12:29:03 AM by Sigma » Logged

roboprez
Level 1
*


Got to love them pixels


View Profile WWW
« Reply #1 on: October 23, 2009, 02:33:24 AM »

umm... Two questions. Are you using 'Actionscript2' or 'Actionscript3'? Plus are you using Flash Professional or Flex(Flash Develop, Flex Builder, mxlmlc.exe)? Sorry for not being that helpful but we kinda need to know these things.
Logged

Sigma
Level 1
*


View Profile WWW
« Reply #2 on: October 23, 2009, 04:32:57 AM »

Hi,
im using as3(flash professional) its in the topic heading itself. anyway i solved the problem now my question is how to convert local coordinates to global coordinates. i have generated a movieclip at runtime and when i drag the movieclip its giving local coordinates and i want its global coordinates how to do that?
Logged

st33d
Guest
« Reply #3 on: October 23, 2009, 05:45:25 AM »

I usually use something like this:

Code:
/* Get a locale from a nested movie clip in relation to another movie clip */
public static function localToLocal(p:Point, mc0:DisplayObject, mc1:DisplayObject):Point{
p.x = p.y = 0;
p = mc0.localToGlobal(p);
p = mc1.globalToLocal(p);
return p;
}
Logged
st33d
Guest
« Reply #4 on: October 24, 2009, 03:41:00 AM »

post code - what you're doing should work but we can't see why you've cocked up
Logged
grapefrukt
Level 1
*



View Profile WWW
« Reply #5 on: October 24, 2009, 04:08:35 AM »

set mouseChildren to false on the container clip, that'll make all mouse events be dispatched from the container and you won't have to deal with the children.

also, post code!
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic