PDA

View Full Version : [FMX] attachMovie() x/y probs



lumpy.
April 5th, 2005, 01:34 PM
howdy - I'm just starting to get spun up with Flash and AS and have run into a bit of a roadblock. I need to have a movieclip launch from within a on (rollOver) {} call. The attaced MC will eventually be populated from some nebulous dynamic source, but in the meanwhile I'm just passing vars as below:

on (rollOver) {
this.attachMovie("unitdetail_mc", "unitdetails", this.getNextHighestDepth());
unitdetails._x = 17;
unitdetails._y = 299;
unitdetails.unitBuilding_txt.text = "Blackbear Lodge";
unitdetails.unitType_txt.text = "2 bedroom plus den";
unitdetails.unitFootage_txt.text = "690 sq ft.";
unitdetails.unitBathrooms_txt.text = "2";
unitdetails.unitParking_txt.text = "heated underground";
unitdetails.unitPrice_txt.text = "$229,000";
unitdetails.unitFees_txt.text = "$170/month";
}

I'm able to load the movieclip using that code, but the "unitdetails" MC is not loading where I expect it to (check the example (http://www.noelflatters.com/dev/aumenta/flash/frames.html) ). The actionscript gets called when you mouseover the reddish button (unit 4) on the left of the floorplan layout. The MC should be loading in the empy space below the floorplan layout.

Any help/pointers that y'all can send my way would be *greatly* appreciated!

mpelland
April 5th, 2005, 01:47 PM
where is the registration of the movie clip that you are moving. if it is in the centre of movie, then you will run into the issue that the clip appears half of its width and height from where you wanted it to be. you can fix that by moving the point or adjusting your x and y

lumpy.
April 6th, 2005, 10:55 AM
Ok, thanks for the registration point idea! Turns out it wasn't that. The file that I had been passed had a mask layer that was messing me up. I was also getting confused as to where stuff needed to be in the timeline, so my scope referencing was waaaay of.

Man, the Flash dev environment is hard to wrap your head around at first for a programmer!!! The movie paradigm is pretty confusing for me still... :puzzled:

At any rate, I'll post the fixed files to the url in my original post shortly.