Solved

calling a  function on the main timeline from a class file

Posted on 2011-09-06
4
297 Views
Last Modified: 2012-06-22
Hi,

when I try to call a function on the maintime line from a class file i get :

TypeError: Error #1006: redArrowAlpha is not a function.

the code is simple:


//blueArrow_select function is called from an addEventListener and works fine...

public function blueArrow_select(e:MouseEvent):void
      {
                  
                  MovieClip(parent).redArrowAlpha();

 
                 }


then in the main time line a simple function...

function redArrowAlpha():void
            {
                  
                  TweenLite.to(redArrow, 5, { alpha:0, ease:Circ.easeOut});
            }



thanks

0
Comment
Question by:nth1971
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 36488799
did you set up a Document class?
where how are you currently trying to access the function resulting in that error?
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 36488846
are you wanting to not use an event listener?
i've just done a quick mock up and it works fine so I think I dont' understand your problem.
I need you to verify what it is you're doing (code that calls redarrowalpha)
0
 
LVL 29

Accepted Solution

by:
dgofman earned 500 total points
ID: 36490409
Hi nth1971,
You need to clarify what actions script language you are using.
If AS2 you may be out of scope in this case you may need to use Delegate class or _root instance or movieclip instance
If AS3 you may have problem by calling parent because is reference to systemManager. In this case try to call parentDocument or document or paren.parent
Thanks
0
 

Author Closing Comment

by:nth1971
ID: 36492884
oh my god, I must be a very tired boy...

its as3 and everything isset up fine I was simply not thinking instead of

MovieClip(parent).redArrowAlpha();

it was

MovieClip(parent.parent).redArrowAlpha();

I'm such a dufus!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question