Skip to main content
fzl_rshd
Inspiring
Aug 15, 2024 12:41 AM UTC
Answered

Can anyone to explain to define Adobe AIR Platform in PC or smartphone in AS3/AS?

Hi, i'm Faizal Arshad Putra Adika. I want anyone to explain AS3/AS code to compare Adobe AIR platform in PC or smartphone. this is a sample code:

if(adobe_air_platform_in_pc)
{
 trace("You're using Adobe AIR Platform in PC");
}
if(adobe_air_platform_in_smartphone)
{
 trace("You're using Adobe AIR Platform in Smartphone");
}

 So, i can make and export a game for PC and smartphone in one project without creating a second ".fla" project, i just use in one "fla" file.

This topic is closed to new replies. Start a new post to keep the conversation going.
JoãoCésar17023019
JoãoCésar17023019Correct answer
Community Expert
Aug 15, 2024 12:14 PM UTC

Hi.

 

Use the Capabilities class. For example:

import flash.system.Capabilities;

function isAndroid():Boolean
{
	return (Capabilities.version.substr(0,3) == "AND");
}

function isIOS():Boolean
{
	return (Capabilities.version.substr(0,3) == "IOS");
}

function isMobile():Boolean
{
	return (isAndroid() || isIOS());
}

if (isMobile())
{
	// your mobile code
}
else
{
	// your desktop code
}

 

I hope this helps.

 

Regards,

JC

6 replies

JoãoCésar17023019
Community Expert
JoãoCésar17023019Community ExpertCorrect answer
Community Expert
Aug 15, 2024 12:14 PM UTC

Hi.

 

Use the Capabilities class. For example:

import flash.system.Capabilities;

function isAndroid():Boolean
{
	return (Capabilities.version.substr(0,3) == "AND");
}

function isIOS():Boolean
{
	return (Capabilities.version.substr(0,3) == "IOS");
}

function isMobile():Boolean
{
	return (isAndroid() || isIOS());
}

if (isMobile())
{
	// your mobile code
}
else
{
	// your desktop code
}

 

I hope this helps.

 

Regards,

JC

Translate
Community Expert
Aug 20, 2024 2:00 PM UTC

This is good JC. Thanks for sharing.

Translate
kglad
Community Expert
Community Expert
Aug 15, 2024 12:55 AM UTC

you can use animate to create ios and android apps.  that said, your code makes no sense because you can't run animate on mobiles.

Translate
kglad
Community Expert
Community Expert
Aug 15, 2024 12:52 AM UTC

in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.



<"moved from using the community">
Translate
fzl_rshd
fzl_rshdAuthor
Inspiring
Aug 20, 2024 8:17 AM UTC

thank you

Translate
kglad
Community Expert
Community Expert
Aug 20, 2024 1:53 PM UTC

you're welcome.

Translate