Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

current frame number of a movieclip #331

Open
ramachandran-prazas opened this issue Mar 11, 2015 · 3 comments
Open

current frame number of a movieclip #331

ramachandran-prazas opened this issue Mar 11, 2015 · 3 comments

Comments

@ramachandran-prazas
Copy link

Hi,

Could you please let me know how I can access the current frame number being played. Its stored at MovieSprite._frame but since its private I can't access it. Is there any other way to do this? Its a flump exported movieclip.

Thanks for your help.

@markknol
Copy link
Contributor

This is a hacky solution but you can add metadata to the function who wants to access the frame number; then you can access private variables. You can create a util class with this function:

@:access(flambe.swf)
public static function getMovieSpriteFrame(movieSprite:MovieSprite) return movieSprite._frame;

See http://haxe.org/manual/lf-access-control.html

I also wonder why frame isn't exposed, @aduros ?

@aduros
Copy link
Owner

aduros commented Mar 11, 2015

No reason, exposing frame would be fine with me.

It's not quite as simple as making _frame public though. _frame is currently only updated in onUpdate, and needs to be synced with position.

@ramachandran-prazas
Copy link
Author

Thanks a lot for the reply. Will try out your suggestions

On Wed, Mar 11, 2015 at 7:11 PM, Bruno Garcia [email protected]
wrote:

No reason, exposing frame would be fine with me.

It's not quite as simple as making _frame public though. _frame is
currently only updated in onUpdate, and needs to be synced with position.


Reply to this email directly or view it on GitHub
#331 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants