Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

calling a  function on the main timeline from a class file

Posted on 2011-09-06
4
Medium Priority
?
300 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 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
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.
Suggested Courses

705 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