Copy link to clipboard
Copied
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.
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
Copy link to clipboard
Copied
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">
Copy link to clipboard
Copied
thank you
Copy link to clipboard
Copied
you're welcome.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
This is good JC. Thanks for sharing.