Solved

calling a  function on the main timeline from a class file

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Youtube video error 30 698
bandwidth 5 64
Google Chrome pepflashplayer.dll 8 113
Adobe Flash Player ActionScript error 6 50
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…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
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 use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now