[A.S 2] need help to debug many stuff from xml based image gallery

hi everyone, i found a very nice tutorial about making an xml based gallery from oman3D which i use it as a base and change some codes abit for my own gallery project… but those modification comes with bugs that i can’t figure out that makes me feel like stop learning this and kill myself T_T

among few things, i tried to add auto resize, auto center and a crossfade transition for the images but it has awesome bugs that i cant figure out why it happens… i really appreciate if anyone can give me insight on what probably went wrong :slight_smile:

most annoying bugs i got is that when i tried to center an image, which i did by substracting the default width and height of the gallery with the loaded image’s width and height then divide it by 2 and adding the default position of the gallery so it should practically comes out with x and y that puts the image on the center of the allocated gallery space

well, it works but apparantly the image’s height and width are rubbish, because sometimes the number is accurate and other times it may changes… i wonder is it accurate to get image’s width and height property if that image is loaded with loadClip and the props are checked during onLoadInit

second bugs is that i tried to create a crossfade transition… or to the least a fade in-out transition, for the latter i manage to make it work by using tween script which starts fade out the old image and start the fade in of the new image using the onMotionComplete function

but after modifying other scripts it stops working for reasons i can’t figure out… also the tween script i added for reasons unknown will reset the position of the loaded images to 0,0 and i dont really have any idea on how to crossfade this ( the only thing i can think of is that i would duplicate the old image’s mc then fade it above the new but it doesnt seem to work)

as for the auto-resize function i made, it did works perfectly until i figure out the original mc’s size cannot be reverted back, so if i load a very large image, then unless the next image is as large or larger than the previous one, it becomes tiny… even after i tried to reset the mc’s prop before every new images loaded…

i have my fla posted along with other materials in a zip, i am really kinda stuck on this for weeks by now :frowning: :frowning: i really appreciate if anyone can help me out! thanks in advance >.<