Sunday, March 28, 2010

Flash Scripting not being recognised in...

Dear all, I hope someone can help.

I am placing Flash created sections into a Captivate e-learning module and although my Flash (MX) file works perfectly in Flash (SWF), parts of it stop working when placed within Captivate (CP4)

Quick description. The Flash file is an interactive menu, and I wanted a way of telling the user that they had already visited a section, so I created a ''tick'' that appeares when the user clicks on the button. I simply set the visibility to ''True''. on the button action.

The issue is that I have a bit of scripting on the first frame to set the visibility to ''False'' to turn off all the ticks. This works great as a standalone SWF, but as soon as it goes into Captivate it no longer works.

Here is the script to turn off the ticks...located on the first frame of the movie

this.onEnterFrame = function () {
_root.tick1._visible=false;
_root.tick2._visible=false;
_root.tick3._visible=false;
_root.tick4._visible=false;
_root.tick5._visible=false;
_root.tick6._visible=false;
_root.tick7._visible=false;
_root.tick8._visible=false;
_root.tick9._visible=false;
_root.tick10._visible=false;

}

Here is the script to turn on a tick from a button press. Pressing the button takes the user to a new section, and on entering the section, the tick appears...The script is atached to a frame at the start of a new section....

stop();
this.onEnterFrame = function () {
_root.tick1._visible=true;

}

Any help would be greatly appreciated...

Flash Scripting not being recognised in...

Once you import your Flash file into Captivate then _root is no longer the _root of your Flash movie, but instead the _root of the Captivate movie. Therefore any references to your ticks using _root would go to the Captivate movie and not the Flash movie.

There are a couple of ways to fix it.

1. Try adding this._lockroot = true; in the beginning of your AS on the first frame.

2. Exchange _root for this. and _parent. when you reference your movieclips and functions.

/Michael


Click here to visit the www.captivate4.com blog

Flash Scripting not being recognised in...

Thanks a milion for that...makes perfect sense now!! D'oh!

All I did was add this._lockroot = true; to the first frame and it worked. No need to change the rest

Thanks again..should have been obvious to me..I am just out of practice!

No comments:

Post a Comment