Copy link to clipboard
Copied
How can an AS3 widget change state of a object in Captivate 9?
I can show of hide a object through as3,but I can't change state of a object , Who can help me?
var slide:Object;
var child:DisplayObject;
slide= parent.parent.parent;
for (var i:Number = slide.numChildren - 1; i >= 0; i--) {
child = slide.getChildAt(i);
if(child.name.substr(0,4)=="abc"){child.visible= !child.visible;} ;
Copy link to clipboard
Copied
How can an AS3 widget change state of a object in Captivate 9?
I can show of hide a object through as3,but I can't change state of a object , Who can help me?
var slide:Object;
var child:DisplayObject;
slide= parent.parent.parent;
for (var i:Number = slide.numChildren - 1; i >= 0; i--) {
child = slide.getChildAt(i);
if(child.name.substr(0,3)=="abc"){child.visible= !child.visible;} ;
Copy link to clipboard
Copied
I think you are going to have to output all of the children in your loop to see how Captivate is creating the states. I could be another movieclip or it could be a different frame or the same movieclip, you don't really know.
You could do a simple project with just the object and a state, don't use you widget, publish and use a Flash decompiler to see how it is created. SoThink has a great one with a trial. JPEXS also has other features
Copy link to clipboard
Copied
I run the as3 code to list all of the objects on the slide,
for (var i: Number = slide.numChildren - 1; i >= 0; i--) {
child = slide.getChildAt(i);
if (child.name) { captivateVariables["cpisondomain" + i] = child.name; }
}
}
I use the code to show or hide a object, it works.
if(child.name.substr(0,1)=="a"){child.visible= !child.visible;} ;
But the way of controlling button in captivate is too complex Generally a button has three states, if you add a state, there will be four states. The icons of the following three states are named after Item_number. Each button also has a clickArea object and a normal icon. I can show or hide an icon, but the clickArea of the button remains. Captivate still records the status and action of the button before.if I revist the slide , the button will return to the original state.
I want press one click to show or hide many objects in captivate,and Now I have to spend more time doing these work by share actions。
Copy link to clipboard
Copied
I would think that you could add event listeners to the click area and show hide all items based on a naming convention. Just don't assign any action to those click areas/buttons. When you enter the slide put all items with a similar name in an array, then on click hide/show those items. I do that kind of thing with JavaScript in HTML5 all the time. Just use strict naming conventions
Copy link to clipboard
Copied
Why do you need a widget to do this when it can be very easily done using normal Advanced Actions?
Copy link to clipboard
Copied
i have many objests with “ABC” as a prefix,and the project has many slides, I want to get these things done once in a while. Can you help me?
Copy link to clipboard
Copied
You could also use Shared actions, I don't know if setting up a widget each time would save that much time over shared actions.
Copy link to clipboard
Copied
I know you mentioned that you were looking for an AS3 solution, which would tend to indicate you are only thinking of SWF output, however, I would also suggest you consider the possibility of publishing instead to HTML5.
The reason for this is that then you could use the CpExtra HTML5 widget for Captivate 9 to easily manipulate object states simply by reason of some clever naming of the objects and the use of @syntax or #syntax when specifying actions in CpExtra.
More information here:
http://www.infosemantics.com.au/adobe-captivate-widgets/cpextra/help/object-states
See the xcmndChangeState command variable.