Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to pass a reference of a movieClip made in one class to another?
    primarykey
    data
    text
    <p>I have a movieClip with a button that I created inside of my display class <em>Thumbnail.as</em> and I have a button function that interacts with it inside of my ui class <em>ThumbnailController.as</em>. </p> <p>The current problem I'm having is that; in my ui class I can't target the movieClip playGlow which was created inside of my display class.</p> <p><strong>Code that creates the playGlow button inside my display class</strong> (Thumbnail.as)</p> <pre><code>public function playBtns():void { playThumb = new PlayThumb; playThumb.x = 642; playThumb.y = 22; playThumb.alpha = 1; playGlow = new PlayGlow; playGlow.x = 628; playGlow.y = 8; playGlow.alpha = 1; } public function buildRow ():void{ thumbNailRow.addChild(thumbLoader); thumbNailRow.addChild(thumbTitle); thumbNailRow.addChild(thumbText); thumbNailRow.addChild(playGlow); thumbNailRow.addChild(playThumb); playThumb.addEventListener(MouseEvent.ROLL_OVER, rowRollOver); addChild(thumbNailRow); } </code></pre> <hr> <p><strong>Now the code inside of my ui class</strong> (ThumbnailController.as)</p> <pre><code>public function rowRollOver(e:MouseEvent):void { dispatchEvent(new Event(Event.CHANGE, true )); TweenPlugin.activate([TintPlugin]); TweenLite.to(playGlow, .4, {alpha:.5, tint:0x99cc00}); } </code></pre> <p>This is the problem line: TweenLite.to(<strong>playGlow</strong>, .4, {alpha:.5, tint:0x99cc00});</p> <p>It will only work when like this: TweenLite.to(<strong>this</strong>, .4, {alpha:.5, tint:0x99cc00});</p> <p>But if I use <strong>this</strong>, the entire thumbNailRow movieClip will tint, I just want to tint the <strong>playGlow</strong> movieClip which is inside of thumbNailRow, but I don't know how to target that specifically. I get the 1120: Access of undefined property <strong>playGlow</strong> otherwise.</p> <hr> <p><strong>How can I pass the instance of playGlow into my ui class so I can target that movieClip with my tint tween?</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload