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 →
Batch Conversions
Yoinked this from eHow. http://www.ehow.com/how_5150630_batch-change-file-extensions.html Totally handy, for example for renaming stupid panasonic .MOD files to .mpeg for video editing. 1 Move the files you want to augment into the same folder or directory. All these files need to have the same extension. 2 Open the Notepad program and type the command line ren *.123... Continue Reading →
Move rows up and down in DataGrid / List AS3
If you create two buttons, 'itemUpBtn' and 'itemDownBtn', and a datagrid of name 'itemGrid', with a column of ID's in it, you can move items up and down using this code. Fairly user friendly, as it re-selects the moved item once it's moved (just relies on that ID column to move them around). Below is... Continue Reading →