#def Compile ( html5 target )

Hello.
I’m trying use

#if mobile
someSprite.width = 200;
#end

it doesnt work on IOS for example or Android I see.

I want to check - mobile browser or desktop browser. Thanks

You can’t do that with conditional compilation, that happens at compile time - you need some check that happens at runtime with a regular if.

I’m not sure if OpenFL has something built-in for this. Check out Flixel’s implementation for it, that maybe be helpful:

Here is a sample of the code to detect mobile browser :

Big Thanks guys!!!