Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

calling a  function on the main timeline from a class file

Posted on 2011-09-06
4
Medium Priority
?
304 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 2000 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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 …
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…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
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.
Suggested Courses

926 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