drydo
08-03-2009, 11:12 AM
I'm experiencing an unusual problem in Flex where I can retreive symbols from an embedded SWF - but when I try to resize the movieclip it ignores the setting?
Here's a quick snippet...
// Embedded Library Item
[Embed(source="C:\\Art-Store\\Mono\\Air\\AirPlayer\\bin-debug\\Masks.swf", symbol='TR_BoxIn')]
[Bindable]
private var TwoBox_CrossoverSymbol:Class;
// Load the library item
mMaskMovie = new TwoBox_CrossoverSymbol() as MovieClip;
mMaskMovie.gotoAndStop(1);
// Position
mMaskMovie.x = mParent.ScreenWidth / 2;
mMaskMovie.y = mParent.ScreenHeight / 2;
mMaskMovie.visible = true;
// Set the dimensions
mMaskMovie.width = mParent.ScreenWidth;
mMaskMovie.height = mParent.ScreenHeight;
// Then add
this.addChild(mMaskMovie);
In short, setting the width and height simply doesn't work and tracing out the dimensions makes no difference. I've also tried wrapping the MovieClip into DisplayObject and utilising the 'setActualSize' but that didn't work either. Has anyone experienced this before or does Flex enforce the Width and Height of embedded symbols from an external SWF?
[Note: this code works perfectly in AS3 / Flash 10]
Thanks in advance
Here's a quick snippet...
// Embedded Library Item
[Embed(source="C:\\Art-Store\\Mono\\Air\\AirPlayer\\bin-debug\\Masks.swf", symbol='TR_BoxIn')]
[Bindable]
private var TwoBox_CrossoverSymbol:Class;
// Load the library item
mMaskMovie = new TwoBox_CrossoverSymbol() as MovieClip;
mMaskMovie.gotoAndStop(1);
// Position
mMaskMovie.x = mParent.ScreenWidth / 2;
mMaskMovie.y = mParent.ScreenHeight / 2;
mMaskMovie.visible = true;
// Set the dimensions
mMaskMovie.width = mParent.ScreenWidth;
mMaskMovie.height = mParent.ScreenHeight;
// Then add
this.addChild(mMaskMovie);
In short, setting the width and height simply doesn't work and tracing out the dimensions makes no difference. I've also tried wrapping the MovieClip into DisplayObject and utilising the 'setActualSize' but that didn't work either. Has anyone experienced this before or does Flex enforce the Width and Height of embedded symbols from an external SWF?
[Note: this code works perfectly in AS3 / Flash 10]
Thanks in advance