Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > Simple Stuff (Newbies)

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-22-2012, 04:25 PM   #1
Businesstoast
Registered User
 
Join Date: Aug 2012
Posts: 1
Post Accessing functions problem

(May involve flashpunk.) I have a function advanceLevel() in MyGameWorld. MyGameWorld creates the player and the level. I want to call advanceLevel() inside the player with a line like this:

MyGameWorld.advanceLevel();

But, I get an error like this:

"Error: Call to a possibly undefined method advanceLevel through a reference with static type Class."

How do I access this function?
Businesstoast is offline   Reply With Quote
Old 08-23-2012, 09:16 AM   #2
Poony
Senior Member
 
Poony's Avatar
 
Join Date: Aug 2011
Location: Sweden
Posts: 387
Default

Relative to the player, the function exists in parent.
ActionScript Code:
MovieClip(parent).advanceLevel();
Poony is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:11 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.