General questions about NeoAppBuilder - our rapid application development tool for building HTML5, web and mobile apps.
Moderator: Neosoft Support
by TinTin » Thu Apr 21, 2016 8:34 am
Hi all,
Trying to change opacity of object at runtime.. not proving that easy. Any help appreciated.
.// Initial Colour Needed! (Brightness Level)
HideObject "Box" "" 0
SetObjectStyle "Box" "background-color" "#FF00FF"
RandomEx 1 10 [Random]
Math "[Random]/10" -1 [RandomBrightness]
SetObjectStyle "Box" "opacity" "[RandomBrightness]"
ShowObject "Box" "" 0
-
TinTin
-
- Posts: 164
- Joined: Sun Dec 06, 2009 4:03 am
- Location: UK
by Neosoft Support » Thu Apr 21, 2016 6:31 pm
Change the second parameter in the Math action from -1 to 2. For example:
RandomEx 1 10 [Random]
Math "[Random]/10" 2 [RandomBrightness]
SetObjectStyle "Box" "opacity" "[RandomBrightness]"
Using -1 will round the result of the calculation which isn't what you want. Opacity must be a value between 0.0 and 1.0. Example: 0.5 would be 50% opacity.
NeoSoft Support
-
Neosoft Support
- NeoSoft Team
-
- Posts: 5621
- Joined: Thu Mar 31, 2005 10:48 pm
- Location: Oregon, USA
-
Return to General NeoAppBuilder Discussion
Who is online
Users browsing this forum: No registered users and 1 guest