This content has been marked as final. Show 3 replies
This is a very basic problem, you are creating onPress event on to the same clip in which you are loading an image. Just create another new movieclip in thisMC and load thumbnail image in to that. But remember to create onPress event on thisMC only not on new movieclip. Please let me know if this solution not works for you.
Thanks & Regards
Project Leader(Flash and Flex)
let your thoughts fly to others... you will become rich.
sorry Ankur, I disagree - the problem is not that the handler is being assigned to the first MC, but rather that is is being assigned previous to there being any content within it - and if using your method you would still need to construct an MC instance that has 'something' in it that is the same size as the loaded image (eg. like a API draw box, or another MC from the Lib that is the correct size)
a better solution is to assign the handler using the onLoadInit method of the MCL class, as I will show below.
However Christian, I am wondering about this call: loadClip(this.id) - if you have defined a method with this name, that will be in conflict with the same named method of the MCL class, i would change that to like 'loadImage' or something ;)
I'm going to sit on the fence and agree with both of you. :)
Loading an image into a target clip knocks off the property assignments, and although I haven't tried that specifically with an onPress handler, I'm guessing that's what's happening here too. I've come across this in the past also using the Zigo tweening engine. So Ankur's suggestion to load the image into a child clip of the current target should work, because the properties assigned to the current clip, which is now the parent should not be affected.
And clbeech's method would work too...by delaying the assignment of the properties until onLoadInit, you can be sure that they will be assigned after the image has loaded... and therefore will be successful.