Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can an AS3 widget change state of a Captivate object?

Community Beginner ,
Feb 07, 2017 Feb 07, 2017

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;} ;

TOPICS
Advanced
448
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 07, 2017 Feb 07, 2017

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;} ;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Feb 09, 2017 Feb 09, 2017

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 10, 2017 Feb 10, 2017

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。

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Feb 10, 2017 Feb 10, 2017
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 07, 2017 Feb 07, 2017

Why do you need a widget to do this when it can be very easily done using normal Advanced Actions?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 07, 2017 Feb 07, 2017

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 08, 2017 Feb 08, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 08, 2017 Feb 08, 2017

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

http://www.infosemantics.com.au/adobe-captivate-widgets/cpextra/help/command-variables/captivate-act...

See the xcmndChangeState command variable.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources