This was suprisingly annoying, AS2 is out of control. As usual Kirupa came through in the end. Here's a snippet: this.createEmptyMovieClip("container", "100"); my_mc = new MovieClipLoader(); preload = new Object(); my_mc.addListener(preload); preload.onLoadStart = function(targetMC) { trace("started loading "+targetMC); container._visible = false; bar._visible = true; border._visible = true; pText._visible = true; }; preload.onLoadProgress = function(targetMC, lBytes,... Continue Reading →
Line breaks in Captivate
Captivate uses \r instead of \n for line breaks.
adding commas to big number counts in AS3
Just a handy snippet I pinched: function addCommaInNumber (number : Number) : String { var integer : String = "" ; var fraction : String = "" ; var string : String = number.toString(); var array : Array = string.split("."); var regex : RegExp = /(\d+)(\d{3})/; integer = array[0]; while( regex.test(integer) ) { integer =... Continue Reading →
Getting TextField to show latest additions / last lines
Pretty straightforward: debugField.scrollV = debugField.maxScrollV;
Use jQuery to make an array of div items
var boxes = $('.box'); $(boxes[0]).click(function() { alert('hi'); }
Adding data to divs with jQuery
I am only beginning to experiment with JS with more depth, and have discovered jQuery has a data function which lets you store data against individual divs. Really useful for some bits and peices! $("#box0").data("uniqueID", 0); $("#box1").data("uniqueID", 1); Then to call it, $("#box0").click(function() { alert($(this).data("uniqueID")); I'll find out how to loop that through a set... Continue Reading →
Value from previous sheet in Excel
I changed this to not give an error if it finds nothing, but to produce 0. Used for accumulating overtime, so very important you see. Function PrevSheet(Range As Range) Application.Volatile PrevSheet = Application.Caller.Parent.Index If PrevSheet = 1 Then PrevSheet = 0 ElseIf Sheets(PrevSheet - 1).Type <> -4167 Then PrevSheet = CVErr(xlErrNA) Else PrevSheet = Sheets(PrevSheet... Continue Reading →
Javascript – re-focus on parent window after closing child
Great for CP simulations. As easy as below (run from the js-opened child window/simulation) window.opener.focus(); window.close();
Captivate replacing itself with [object] when running Javascript
I've been trying to run javascript through Captivate to do some nice popup windows for a sub-simulation. When the javascript finally works, it'd replace the main clip with [object] - ie. it would run the URL in its own URL, so you'd see '[object] displayed on screen, rather than the CP movie! Pretty silly. Anyway,... Continue Reading →
Slides freezing during quiz in Captivate
I've been struggling with an issue of learning checks in a Captivate (5.5) course. I changed the 'skip' and 'back' buttons on a question slide to have the same style as the 'Next' and 'Back' buttons for the main navigation. However, what happened when reviewers actually used the course, is that if you went back... Continue Reading →
Captivate Variables
You can print a variable by putting $$'s around it in a caption. $$cpInfoPercentage$$ List of variables and what they do (ty!): http://www.cpguru.com/adobe-captivate-5-system-variables/
Captivate SCORM scoring when you only want completion
We had a problem where we wanted a module to only complete based on slide views. What we were getting in Moodle (Totara) was fine, it was marking complete fine, but it'd show all this 'you failed' and showing scores we weren't reporting and all sorts of crazy garbage. Captivate just sends all the garbage... Continue Reading →