Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

iAd producer and html5 canvas

I am familiar with producing iAds using JavaScript but have hit upon a problem when using the HTML place holder from the 'Dynamic Content' section.


I have set up the htmlView.html file with the following code:


<div><canvas width="1000" height="600" id="mywizzycanvas"></canvas>

<script>

var can = document.getElementById('mycanvas');

var ctx = can.getContext('2d');

</script>

</div>


and have then used sliders to draw to the canvas.


The iAd works perfectly when previewed in iAd Producer, it works perfectly when previewed in Safari, but when exported to the .wdgt format and placed in an iBook the sliders cease to work. I have tried exporting the iBook but still nothing. I would be very grateful for any help or assistance with this.

Posted on Mar 17, 2015 12:10 PM

Reply
Question marked as Best reply

Posted on Mar 18, 2015 11:36 AM

Based on your provided code sample, your IDs don't match, i.e. "mywizzycanvas" vs. "mycanvas".

4 replies

Mar 18, 2015 11:47 AM in response to patixa

Many thanks for your reply patixa. Apologies for my incorrect typing of IDs, in my iAd code they do match.


I have managed to resolve the problem as follows:


All of my iAd content was originally on the Background layer. Placing the content on Page1 has resolved the problem.


I'm not certain as to why the project worked in iAd producer preview/Safari/Widget preview but not in iBooks but no matter, switching to Page 1 solves it completely.


I notice from a few of the problems people have posted that they have a similar situation and wonder if this might be something that would help them. I've not posted replies but wonder if someone more experienced might offer a view.


Many thanks again to patixa, your kindness is greatly appreciated.

Mar 29, 2015 5:49 AM in response to kiotsukete

Many thanks kiotsukete, very wise advice to follow, particularly before investing too much time in a particular project.


In addition to my comments above, selecting the option in iAd Producer to 'Export to Disk (Optimised)' ensured that the project worked even in preview mode for iBooks Author.


Thank you again to both patixa and kiotsukete for their help.

iAd producer and html5 canvas

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.