Announcements
The Scaleform forum is now read-only. Please head to the Gamedev site for product support.
Scaleform Forum (Read Only)
Scaleform enables developers to leverage the power of the Adobe® Flash® tool set to create powerful user interface environments for video games.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[ANSWERED] Simplest Way to Determine in AS3 if Running in Unity

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
312 Views, 2 Replies

[ANSWERED] Simplest Way to Determine in AS3 if Running in Unity

I know I can pass data from Unity to Flash, and therefore know we are running in Unity, and conversely I could timeout waiting for this data and therefore assume we are not running in Unity. I have done this, but it seems inelegant.

I wondered if there's a simpler way in AS3 to distinguish between whether we're running in Unity or the standalone FxMediaPlayer.exe? Working in Flash and testing with FxMediaPlayer.exe is a much smoother workflow, so I hope I've overlooked a simple property in a Scaleform class somewhere.
2 REPLIES 2
Message 2 of 3
MatthewDoyleArt
in reply to: Anonymous

You should be able to determine that using the Scaleform Extensions "isGFxPlayer" and "isScaleform".

Just use:

import scaleform.gfx.Extensions
Extensions.enabled = true;

trace("isGFxPlayer", Extensions.isGFxPlayer);

Returns true in standalone player
Returns undefined in Unity

Matthew Doyle
Technical Marketing Manager

-----------------------------

Area Blog: Game Dev Blog
Watch me on Youtube: Youtube.com/MatthewDoyleArt
Check out some of my work at: MatthewDoyle.com
Message 3 of 3
Anonymous
in reply to: Anonymous

Just what I needed. Thanks Matthew.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report