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
Solved

calling a  function on the main timeline from a class file

Posted on 2011-09-06
4
294 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
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to how to record live broadcast.

856 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