Problems trying to access a MovieClip that contains a dynamically loaded
image, inside dynamically created menu items.

I hope the code is self explanatory !

function mouseOverItem(e:Event):void {
var item:MenuItem = as MenuItem;
 trace (item.getChildAt(3).name);
trace (item.getChildAt(3));
trace (item.bt_title);
 trace (item.getChildAt(4).name);
trace (item.getChildAt(4));
trace (item.icone);

new GTween(item.bt_title, 0.3, {y:25}, easing1);
new GTween(item.bt_subtitle, 0.3, {y:25}, easing1);
new GTween(item.icone, 0.3, {y:100}, easing1);            /*/ doesn´t work!!

*The tracing output this:*

[object MovieClip]
[object MovieClip]
[object MovieClip]

*QUESTION: Why do i get undefined? shouldn´t I get  "[object MovieClip]"
instead ?*


In case this code is not clear:

function iniciarMenu ():void{

for (var i:Number = 0; i < my_total; i++){

var menuItem:MenuItem = new MenuItem();
menuItem.x = (menuItem.width + 2)*i;
menuItem.bt_title._txt.text = my_items[...@title;
menuItem.bt_title._txt.antiAliasType = AntiAliasType.ADVANCED;
menuItem.bt_subtitle._txt.text = my_items[...@subtitle;
menuItem.bt_subtitle._txt.antiAliasType = AntiAliasType.ADVANCED;

menuItem.linkTo = my_items[...@link;
menuItem.mouseChildren = false;

menuItem.addEventListener(MouseEvent.MOUSE_OVER, mouseOverItem);
menuItem.addEventListener(MouseEvent.MOUSE_OUT, mouseOutItem);
menuItem.addEventListener(MouseEvent.CLICK, itemClicked);

menuArray[i] = menuItem;

var iconURL = my_items[...@icon;
var iconLoader = new Loader();
iconLoader.load(new URLRequest(iconURL)); = i;
iconLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, iconLoaded);


function iconLoaded(e:Event):void{
var my_icon:Loader = Loader(;
var iconMC:MovieClip = new MovieClip();

iconMC.x = 100;
iconMC.y = 35;
iconMC.alpha = 0; = "icone";
new GTween(iconMC, 0.9, {alpha:0.8}, easing1);
 my_icon.contentLoaderInfo.removeEventListener(Event.COMPLETE, iconLoaded);
my_icon = null;
Flashcoders mailing list

Reply via email to