Q: help with debugging in iadproducer
Hi,
I am new to iadproducer and am struggling with the interface and lack of searchable documentation. I have a few questions which will get just set me up to get going:
1) The marketing blurb indicates there are great debugging tools with one click breakpoints etc. I cannot find this. If I am in the JS Code editor, no matter where i click I cannot set a break point. So this question is a little bigger than just break poiints - How do I activate and use a debugger in iadproducer.
2) If I make silly syntax mistakes in Javascript like coding an if statement with a then or using an incorrectly spelt property, the code continues fine and has weird behaviour. Would be great if it would let me know i screwed up. I am sure there must be a hidden output window somewhere that will inform me of such mistakes?
3) the marketing blurb also indicates the tool has autocompletion. I have struggled to find this also. I am assuming this means if I have a layer variable and add a dot I should get to see all properties of a layer.
4) Documentation. Here I am asking a specific question on documentation I cannot find. My real goal is to understand how to find similar answers... I have some example code using layer.style.top - how would I find documentation describing this?
Pointers to get me going with the above javascript development components of this tool greatly appreciated.
Regards
Paul
iBook, OS X Mavericks (10.9)
Posted on Jan 14, 2014 6:32 PM
KPWatts wrote:
2) I have added some silly errors - my "then" on the if statement came out as a syntax error in theconsole log. Thanks for this info... However creating an invalid property gives no warnings or errors. ie setting layer.hide=true; instead of layer.hidden=true; This is now less of an issue now I have codesense switched on, but still feels wrong.
Sorry if I sound like a jerk, but "Welcome to JavaScript!". It's a very dynamic langauge with little validation, so "layer.hide" is just as valid as "layer.hidden". This design makes the language very flexible and powerful, but at the cost of unexpected behaviors to those (like me) more familiar with languages with stricter constructs.
4) I am working a through the "space tours to mars" iad project trying to understand and replicate the "pinch spread" feature. In the javascript code it is doing many things one of which is layer.style.top=0. Again - not really important I get this specific answer, but I would love to find the documentation to let me know exactly what these properties do, so I can then find the answers to the rest. I agree that iadproducer is great for defining and moving many layers/objects, but some things we need to go to code for. At that point I would love to know how to navigate the documentation. I searched and searched the documentation for layer to answer the above specific question - and come up with nothing.
I recommend watching the two WWDC 2013 presentations about iAd Producer:
- Session 609, "Introduction to iBooks Author Widget and iAd Rich Media Ad Development with iAd Producer 4"
- Session 611, "Building Advanced iBooks HTML 5 Widgets and iAd Rich Media Ads"
You can find the videos on the ADC site:
https://developer.apple.com/wwdc/videos/
They were invaluable to me!
The Help > Code Documentation menu item is a place to dig through once you have the basic orientation.
Finally, if you're feeling brave, you can use the Remote Web Inspector to introspect the objects and figure out their prototypes and properties. (In JS, objects derive from a "protoype" and not a superclass, so the "__proto__" property defines each object's inheritance.) WWDC 2013 sessions 601 and 603 cover the Web Inspector.
Hope that helps!
Posted on Jan 15, 2014 6:32 PM