|
Prev: Parent Code
Next: Protected Movie
From: Rothrock on 5 May 2008 11:40 I don't know what the answer is, but when I used gskinner's detection class I found that if I had scaled the stage or resized the stage that the detections would fail. It had something to do with these lines: var mat:Matrix = p_clip1.transform.concatenatedMatrix; The concatenatedMatrix was somehow getting off and it was causing the problem. I think I just uses the regular matrix and that worked, unless the clip was rotated or something like that. I never really needed to fix it so I didn't get to far into it. Hope that helps you find a way...
From: rritchey on 5 May 2008 13:21 The swf should not be getting scaled at all on load. IE - the scaleContent property of the Loader is set to false. Any other ideas?
From: Rothrock on 5 May 2008 14:08 In my case I wasn't loading anything at all. I just found that in the testing environment if I resized the window everything went wonky. So it isn't exactly resizing it is resizing or moving of the stage. So you are loading it dynamically, right? Do both swfs have the same original size? I'm also guessing since you had questions about getBounds() that the origin isn't the same for all of these different swfs? I'm certain the problem lies down this path, I'm just not sure exactly where or how! In my case to figure it out I added a bit to the collision detection to draw the bitmaps it was using for the collisions. And I could see that they were shifted.
From: rritchey on 6 May 2008 07:38 Fixed it! Thanks for all the help guys. Apparantly all that was necessary was to change "concatenatedMatrix" to "matrix" and it suddenly works in the interface. Not quite sure what the difference is between the two, nor why it would make a difference (I haven't yet quite figured out the whole "matrix" idea) but it works now.
From: Rothrock on 6 May 2008 09:53
Glad that worked out for you there. But remember there are now situations where it won't work because you aren't using the concatenatedMatrix! I think it is you rotate the loaded clips, but I can't really remember. I've found (with my brief experience) that situation is more rare for the type of work I do. But anyway if you change your design be sure to test the collision detection! |