PDA

View Full Version : onClip(data)mc._width=12 not working properly


Paul Ferrie
02-08-2006, 06:53 PM
Hi guys.

Whats the deal with _width.
I am loading video(swf) into it's own mc and using "onclipEvent(data)" to set width and height of the movie once it has loaded. The height works fine but the width does not. It only seems to effect swf movies. images load and dimenssions can be changed without any problems.

Anyone

THanks

Paerez
02-08-2006, 07:04 PM
I don't know if this is applicable in your situation, but for many components _width and _height don't work for setting, .width and .height are for reading, and setSize(w, h) is for setting.

Paul Ferrie
02-08-2006, 07:08 PM
5 years of flash i have never used setSize for mc properties.
i will give it a go thanks

Paerez
02-08-2006, 07:13 PM
Well no its probably not for MCs.

Are you sure the MC is fully loaded, not just placed on the stage? Also, can you elaborate on: the width does not.

Paul Ferrie
02-08-2006, 07:22 PM
The movie loads and plays but is out of contraints due to the _width not setting

onClipEvent (data) {
this._width = 640;
this._height = 480;
}

Movie being loaded is 320*240
The height adjust's ok but not the width

Paerez
02-08-2006, 07:26 PM
hmm that is very bizarre. Have you tried using ._xscale = 200 instead?

Paul Ferrie
02-08-2006, 07:30 PM
i didnt no but will try

Paul Ferrie
02-08-2006, 07:31 PM
THat did it

onClipEvent (data) {
this._xscale = 200;
this._height = 480;
}


Very strange...
Thanks

Paerez
02-08-2006, 07:33 PM
you're welcome. Flash can be weird sometimes. Doubling the width with _xscale also will set _width to double the original. It is an odd system.

Paul Ferrie
02-08-2006, 07:35 PM
Strange that it is only effecting video converted to swf