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: 

Problem with progress bar

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
659 Views, 0 Replies

Problem with progress bar

Hello

 

I've encountered a problem while scripting HUD for my Stigray project.

 

The problem:

Script won't let Me manage the value of bar progression via sliderApi.setValue(x) as shown  on page Scaleform docs, insted it returns:

  attempt to call field 'setProgress' (a nil value) or attempt to index local 'PROGRESS_BAR_API' (a nil value)

since I've tried to make two calls respectively to given result

PROGRESS_BAR_WIDGET.setProgress(26)
PROGRESS_BAR_API.setProgress(26)

Script that make tha call is attached to "data_frame", progress bar is named "PRODUCTION_BAR".

I've changed only name in progressbar widget.

 

local thisActor = ...
local actorName = scaleform.Actor.name(thisActor);
local container = scaleform.Actor.container(thisActor);
local componentsNumber = scaleform.ContainerComponent.num_actors(container);

local SELECTED_BUILDING = nil


local PROGRESS_BAR        = scaleform.ContainerComponent.actor_by_name(container, "PRODUCTION_BAR");
local PROGRESS_BAR_WIDGET = scaleform.Actor.component_by_name(PROGRESS_BAR, "WidgetBase");
local PROGRESS_BAR_API    = scaleform.ScriptComponent.script_results(PROGRESS_BAR_WIDGET);
PROGRESS_BAR_WIDGET.setProgress(26)

Thanks in advance

Marcin Wereszczyński

0 REPLIES 0

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

Post to forums  

Autodesk Design & Make Report