Hi, Stuart,
This looks like a job for global function getDefinitionByName(), my new bff
(learned from this list).
You can't instantiate "item" just as a string. You need to call
getDefinitionByName(item) and then use that as your class def.
var classReference:Class = getDefinitionByName(item);
return classReference();
-jonathan
On Thu, Apr 10, 2008 at 7:55 AM, Stuart (FunkDaWeb) <[EMAIL PROTECTED]>
wrote:
> Hi i have another problem this time its to do with masking an object, here
> is the code that creates a movieclip then loads an image into to...
>
> bannerArea = newMovieClip(0xffffff, 0, 0, 420, 173);
> addChildAt(bannerArea,0);
>
> banner.loadImage("banners/" + xmlClass.xmlData.BannerRef + ".jpg",
> 0,0, bannerArea, 420, 173);
>
>
> Then an item is called from the library and applyed as a mask...
>
> var maskClip = loadLibrary("maskMC" +
> xmlClass.xmlData.Mask.toString());
> addChild(maskClip);
>
> bannerArea.mask = maskClip;
>
> This is the function that calls the item from the library (this isnt
> currently working correctly but we have found a quick fix till we have
> worked out the masking problem)...
>
> private function loadLibrary(item)
> {
> var maskClip = new item();
> return maskClip;
> }
>
> Quick fix for code...
> private function loadLibrary(item)
> {
> var maskClip = new maskMC1();
> return maskClip;
> }
>
> The problem areas is not loading items from teh library but its when it
> applys the mask i.e. bannerArea.mask = maskClip;
>
> Any one have any ideas?
>
> SM
>
>
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
--
-jonathan howe :: 404.434.2321 :: 180 High St Apt 26 Portland, ME 04101
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders