Haven't followed this thread, so apologies if this has been hashed out
previously. But this:

function showDetails(e:Event):void
{
        this["details"+e.currentTarget.name].visible=true;
}


Seems unnecessarily complicated.  Seems this should work:

function showDetails(e:Event):void
{
        var mySprite:Sprite  = e.target as Sprite;
        mySprite.visible = true;
}

HOWEVER, the fact you are telling it to be visible AFTER the mouse rolls
over it seems problematic - if it wasn't visible before, then it would
be impossible to trigger a roll over.


Jason Merrill 

Instructional Technology Architect
Bank of America   Global Learning 

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(Note: these resources are only available for Bank of America
associates)





-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr,
Theodore
Sent: Friday, June 11, 2010 11:14 AM
To: Flash Coders List
Subject: RE: [Flashcoders] targeting mc

Basically:

function parseSumXML(e:Event):void
{

   //looping through the xml
   for (var n:int=0; n<totalChildren; n++) {
         obar.graphics.beginFill..... (creating square);
         obar.name = "Assigned"+n;
         obar.addEventListener(MouseEvent.ROLL_OVER,showDetails);

         var barDetails:TextField...... creating textfield;
         barDetails.name="detailsAssigned"+n;
         barDetails.visible=false;
   }    
}

function showDetails(e:Event):void
{
           this["details"+e.currentTarget.name].visible=true;
}

________________________________________
From: flashcoders-boun...@chattyfig.figleaf.com
[flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Matt S.
[mattsp...@gmail.com]
Sent: Friday, June 11, 2010 11:01 AM
To: Flash Coders List
Subject: Re: [Flashcoders] targeting mc

Can you post more of your code? Specifically the code that creates the
intended target in the first place.

.m

On Fri, Jun 11, 2010 at 10:43 AM, Lehr, Theodore
<ted_l...@federal.dell.com>wrote:

> I think it is a matter of scope.... the mc I am trying to affect
> (this["details"+e.currentTarget.name]) is a texfield created in a 
> function
> - so I am guessing it is not accesible outside of that function... 
> there are multiple instances of these textfields... they are created
in a loop like:
>
> var barDetails:new TextField();
>
> ......
>
> barDetails.name=.....;
> addChild(barDetails);
>
>
> I even tried taking the var barDetails:new TextField(); otside of the 
> function, but I get the same error....
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to