Making variables global i iAd Producer

sorry if this is a really simple question. Still, I am stuck:
I would like to have widgets access other widget's variables. I would have thought, for instance, that it would be possible to declare a variable
var Utility = this.viewController.outlets.Utility;
in Global.js, refering to a widget declared in one of the standard auxiliary (.js) files.
I assume that there are more clever ways of doing this. I'm not new to programming, but I'm new to both iAd Producer and JavaScript.
Any and all pointers welcome.
Thank you,

For security reasons, each widget in an iBooks Author book can only access it's own content.
If you meant sharing across pages in a project, then Global.js is the place to store the variables. It's best to assume Global.js can NOT see anything on individual pages, so your idea of using "this.viewController…" likely won't work. Instead, define your Utility class in Global.js (or in another JavaScript file you added as an asset), and reference the objects therein directly from the code in your pages.
Does that help?

Similar Messages

  • Making variable values globally accessible in my code

    I have certain variables, and when I declare their values
    within a function I want the value to be accessible in other
    functions. Right now it's not, so obviously I have a scoping
    problem.
    For this example, I have a function that decides if an avatar
    is too close to the side of the screen, in which case it sets a
    flag var tooClose:Boolean = true; Of course my other functions
    don't see this and aren't getting the message.
    In old 2.0 I would have just said _root.tooClose = true or I
    would have made the variable global.
    Could someone please help me here? Its something I find
    myself needing quite a bit.

    Let me be clearer:
    var myFlag:Boolean = false;
    function resetVariable() {
    var myFlag = true
    function checkVariableValue() {
    trace(myFlag)
    // shows false
    I would like it so when I set the variable myFlag = true in
    the resetVariable function that the global value for myFlag becomes
    "true" and all my other functions are aware of it.

  • FRM-40815 Variable Global.Nodename doesnot exists

    Hi there,
    i am using oracle Dev suite 10g, when i create new form module in form builder, it is runing properly but when i try to open existing forms, and when i run those forms , it generate the following error:
    FRM-40815 Variable Global.Nodename doesnot exists
    plz help me with that......
    thanks in advance

    Well, the obvious answer is that the "Global.Nodename" global variable referenced by your Form doesn't exist. One of the drawbacks to using a Global Variable is that if you haven't instanciated (created) the variable, it does not produce a design time error; they only produce runtime errors if the variable doesn't exist.
    when i try to open existing forms, and when i run those forms , it generate the following error:Are you running the existing forms from the Forms Builder? If so, your applciation may be written so that it creates Global Variables during initial login or through the selection of a menu option, etc. If this is how your application works, you won't be able to run your Form from the Forms Builder unless you know what the values of these Global Variables are and you set them temporarily in your Form using the Default_Value() built-in. If you need more information on using Global Variables, I recommend you search the Form Help system.
    Craig...

  • How can I use WebGLview in the iBook widget template in iAd producer?

    Recently I am trying to use iAd producer to create a iBook Author widget. What I need is to show a 3D .obj file in it. How can I do that? Is WebGL supported in the iBook Author template?

    Per iAd Producer help (https://help.apple.com/iadproducer/mac/5.0/index.html?localePath=en.lproj#/iade7 39fa44):
    Available in ad projects only.
    It was noted during an iBooks Author / iAd Producer seminar I attended that iBooks had not enabled WebGL content, so I encourage you to request support from Apple:
    http://www.apple.com/feedback/ibooks.html
    Alternatively, iBooks Author can present .obj files natively in their own widget:
    http://www.apple.com/ibooks-author/gallery.html#gallery-interactive-3d
    Obviously, the presentation is limited to the object and not any of the other interesting things you might be able to do with HTML and a WebGL object.
    Does that help?

  • IAd Producer and iBooks widget help

    Hello!
    I'm trying to use iAd Producer to create a drawing widget for an iBooks project. So far, I've been able to customize the standard drawing object and it works flawlessly on the iAd Producer Preview and in Safari, but not on the iOS Simulator nor the iPad.
    In the widget, there are 2 brush sizes available (small and large) and I'm trying to give visual feedback to the user, letting them know which one they selected. Initially I started with buttons but that didn't work because buttons don't have a style for on/off to let the user know that that button is selected.
    I switched to radio buttons, which works great on the preview but not the actual device. Here's the code I'm using:
    HTML:
    <label class="brushFrame">
    <input id="smallBrush" class="brush" type="radio" name="brush" value="small"><img src="assets/brush.png" />
    </label>
    <label class="brushFrame">
    <input id="largeBrush" class="brush" type="radio" name="brush" value="large"><img src="assets/brush.png" />
    </label>
    CSS:
    label.brushFrame > input.brush {
      display:none;
    label.brushFrame > input.brush + img {
      cursor: pointer;
      width: 50%;
      height: auto;
      position: relative;
      z-index: 1;
      transition: all 0.1s ease-in-out;
    label.brushFrame > input.brush:checked + img {
      opacity: 0.75 !important;
      z-index: 10 !important;
    Basically, the brush should become transparent when the user selects it and because it's a radio button, it will stay transparent until the user selects the other brush. The iOS Simulator and iPad are able to render all the CSS correctly, except for when the radio button is ":checked". Background: This is my first widget and I'm very comfortable with CSS but not JavaScript.
    How can I make this work?

    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.

  • Creating a youtube widget in iAd Producer for Ibooks Author

    Hello,
    I am trying to create a widget in iAd Producer to add to my iBooks Author template featuring a youtube video.
    I am able to create and save the widget but when I place it into iBooks Author template I get a large gray box with a small black box in the center (the video). 
    Is there a way to correct this? 
    How can I eliminate the outer frame? 
    Any other suggestions on adding a youtube video to iBooks Author?
    Thank you.

    See my answer in:
    https://discussions.apple.com/message/24985089

  • I cannot get my add uploaded to iAd Workbench using iAd Producer

    I am using version 4.2 of iAd Producer and trying upload my add to iAd Workbench.
    I get the following error. Does anybody know how to resolve this error?

    They are not all on iTunes, I copied some over from my old Droid device when I bought the Nano,.  It was my understanding that there isn't a way to get those into iTunes.  Does having initially setup the Nano on a Windows machine have anything to do wish this?  I've switched to a Mac mini as the Windows machine is on life support.  I never had issues downloading from the Windows pc. 

  • How to create an "exit widget" button on iAd producer.

    I am creating a widget for a children's book and would like to create a simple "exit button" (an X the reader can touch to close the widget). Thus far I have created the object, but i can't seem to find an an 'action' to associate with the "activated" event that will close the widget and return to the iBook. I realise that a widget can alternatively be closed with a two-finger gesture, but for simplicity in view of my target audience prefer to have the "exit button". Note: I am relatively new to iBooks Author, and totally new to iAd producer. Unfortunately I don't know how to script in Java or HTML yet, but am willing to learn. Can anyone please give me some pointers?

    Thanks! The button didn't appear in the preview in iAd producer, so I didn't realize it was there. But I tried my widget in iBooks Author and the button is there. Thanks again!

  • How to make a variable global to use in all of my cfm page?

    I have a problem with the variables.
    i need to use a variable  " loginrecord" in all of my cfm pages, its created in my login.cfm and the value of this needed in other page and maybe i need to change it .
    in ASP simply we can use SESSION to make a variable global , is there any way in coldfusion ?
    also in ASP we have a command SESSION.SESSIONID ,  so return the unique number from browser and we can se it as a security check for each one of people login to our site and each one is seperate random and unique number , is there any similar in coldfusion ?
    Thanks
    Alireza

    Thanks,
    the reason at the moment i stock with this command is i need to have login information available in all the pages to check the security. the good point i had in ASP is SESSION.SESSIONID   , it make a unique number base on browser and i can check it if user loged in or no , or if loged in is the same user or other user . i couldnt find same command in coldfusion , and now i use <cflogin> but if i can find the way to have a browser session it help me in other part of my program.
    i start coldfusion new ( near a month ) i have some book and Lynda DVDs, also online sources , and in this priod i re developed one of my program from ASP to coldfusion and its work. i am happy of this and help me to develop better and faster . in compare the coldfusion developed one realy is 40% original development in size and 50% faster . i have good background of ASP in last 8 years include MCSD and developed many program for a small and big companies. but i wanna to continue with coldfusion because i found it more helpfull than ASP specialy in FLASH development .
    BTW thanks for your help

  • IAd Producer download Access Denied

    I have a iOS developer account and i want to download the iAd Producer but it keeps telling me Access Denied.
    And i cant find any refrence how and why i cant download it.
    Any tips/links?

    Please send a message to [email protected] to have them take a look.  You may also download iAd Producer from the downloads site at developer.apple.com/downloads
    -Mark

  • I can't do anything in iAd Producer 4.1

    Hi there ,
    I have download an iAd Producer 4.1 . and when I trying to make some widgets for iBook Author (or any choices) the work space is disapear and I cant add any objects to it , and there is an error massage shown when trying to go back to overview that says : " there is an unexpected error occured " and it was closed from itself .
    I reinstall it again and again and same problem happened . and there is no older version of this app to try it.
    sorry for my english but I'm tired from searching for a solution and there is nothing .

    here is the logs in Console :
    ١٨/١١/٢٠١٣ ١٠:٤٦:٥١٫٨٥٠ م com.apple.SecurityServer[14]: Killing auth hosts
    ١٨/١١/٢٠١٣ ١٠:٤٦:٥١٫٨٥٠ م com.apple.SecurityServer[14]: Session 100056 destroyed
    ١٨/١١/٢٠١٣ ١٠:٤٧:١٦٫٥٤٩ م iAd Producer[1445]: Exception raised:
    NSImageCacheException
    Reason: Cannot lock focus on image <NSImage 0x608000c77e00 Size={0, 0} Reps=(
    )>, because it is size zero.
    User Info: (null)
    Build: 4.1 (4141)
    ١٨/١١/٢٠١٣ ١٠:٤٧:١٦٫٥٤٩ م iAd Producer[1445]: Backtrace: (
              0   CoreFoundation                      0x00007fff8f5c141c __exceptionPreprocess + 172
              1   libobjc.A.dylib                     0x00007fff8ef9de75 objc_exception_throw + 43
              2   CoreFoundation                      0x00007fff8f5c12cc +[NSException raise:format:] + 204
              3   AppKit                              0x00007fff97055329 -[NSImage _lockFocusOnRepresentation:rect:context:hints:flipped:] + 334
              4   AppKit                              0x00007fff970551c9 __51-[NSImage lockFocusWithRect:context:hints:flipped:]_block_invoke + 82
              5   AppKit                              0x00007fff97054626 -[NSImage _usingBestRepresentationForRect:context:hints:body:] + 170
              6   AppKit                              0x00007fff97054567 -[NSImage lockFocusWithRect:context:hints:flipped:] + 207
              7   AppKit                              0x00007fff971d7904 -[NSImage lockFocusFlipped:] + 123
              8   iAd Producer                        0x0000000101466df9 iAd Producer + 613881
              9   iAd Producer                        0x00000001013f7bfa iAd Producer + 158714
              10  iAd Producer                        0x00000001014eeea7 iAd Producer + 1171111
              11  iAd Producer                        0x00000001014eed32 iAd Producer + 1170738
              12  iAd Producer                        0x000000010171c587 iAd Producer + 3454343
              13  iAd Producer                        0x0000000101421807 iAd Producer + 329735
              14  iAd Producer                        0x0000000101421231 iAd Producer + 328241
              15  iAd Producer                        0x000000010142135a iAd Producer + 328538
              16  iAd Producer                        0x0000000101420f2c iAd Producer + 327468
              17  iAd Producer                        0x000000010171c36f iAd Producer + 3453807
              18  iAd Producer                        0x000000010161e6c2 iAd Producer + 2414274
              19  iAd Producer                        0x000000010171bf14 iAd Producer + 3452692
              20  iAd Producer                        0x000000010171bc7f iAd Producer + 3452031
              21  iAd Producer                        0x00000001014eeb8b iAd Producer + 1170315
              22  AppKit                              0x00007fff971773d0 -[NSApplication sendAction:to:from:] + 327
              23  AppKit                              0x00007fff9717724e -[NSControl sendAction:to:] + 86
              24  AppKit                              0x00007fff971c3d7d -[NSCell _sendActionFrom:] + 128
              25  AppKit                              0x00007fff971dd715 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2316
              26  AppKit                              0x00007fff971dcae7 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 487
              27  ProKit                              0x0000000101c5b3cc -[NSProButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 504
              28  AppKit                              0x00007fff971dc1fd -[NSControl mouseDown:] + 706
              29  iLifeKit                            0x000000010231f353 -[IPKButton mouseDown:] + 371
              30  AppKit                              0x00007fff9715dd08 -[NSWindow sendEvent:] + 11296
              31  iAd Producer                        0x00000001015d9b81 iAd Producer + 2132865
              32  AppKit                              0x00007fff970fc744 -[NSApplication sendEvent:] + 2021
              33  AppKit                              0x00007fff96f4ca29 -[NSApplication run] + 646
              34  AppKit                              0x00007fff96f37803 NSApplicationMain + 940
              35  iAd Producer                        0x00000001013d2c64 iAd Producer + 7268
    ١٨/١١/٢٠١٣ ١٠:٤٧:١٧٫٨٣٧ م iAd Producer[1445]: CGSNewCIFilterByName
    ١٨/١١/٢٠١٣ ١٠:٤٧:١٧٫٨٣٨ م iAd Producer[1445]: CGSNewCIFilterByName failed: error 1006
    ١٨/١١/٢٠١٣ ١٠:٤٧:٢٠٫٣٥٣ م iAd Producer[1445]: -[STProjectFile writeSafelyToURL:ofType:forSaveOperation:error:](STProjectFile.m:285) Got error Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “Untitled (Autosave).iadproj”." UserInfo=0x600000a738c0 {NSFileOriginalItemLocationKey=file://localhost/Users/majedsaud/Library/Contain ers/com.apple.iAdProducer/Data/Desktop/Untitled%20(Autosave).iadproj, NSURL=file://localhost/Users/majedsaud/Library/Containers/com.apple.iAdProducer /Data/Desktop/Untitled%20(Autosave).iadproj, NSFileNewItemLocationKey=file://localhost/private/var/folders/w0/9r22h60j2sj8qd qzk0_j75x80000gn/T/com.apple.iAdProducer/TemporaryItems/(A%20Document%20Being%20 Saved%20By%20iAd%20Producer%207)/Untitled%20(Autosave).iadproj, NSUnderlyingError=0x600000a5fc80 "You don’t have permission to save the file “Untitled (Autosave).iadproj” in the folder “(A Document Being Saved By iAd Producer 7)”."} trying to replace /Users/majedsaud/Library/Containers/com.apple.iAdProducer/Data/Desktop/Untitled (Autosave).iadproj with /private/var/folders/w0/9r22h60j2sj8qdqzk0_j75x80000gn/T/com.apple.iAdProducer/ TemporaryItems/(A Document Being Saved By iAd Producer 7)/Untitled (Autosave).iadproj
    ١٨/١١/٢٠١٣ ١٠:٤٧:٢٠٫٤١٣ م sandboxd[291]: ([1445]) iAd Producer(1445) deny file-write-create /Users/majedsaud/Desktop/Untitled (Autosave).iadproj
    ١٨/١١/٢٠١٣ ١٠:٤٧:٢٠٫٥٤٥ م com.apple.launchd.peruser.501[163]: (com.apple.iAdProducer.30832[1445]) Exited with code: 1

  • Compose Email from iAd Producer iBooks Widget

    I am looking for a simple way to email the content of my text fields/forms from my widget I am creating from the new iAd Producer. I've read that there is a "compose email" action, however, in the iBooks Author Widget creator I can't seem to find it. Any help would be appreciated.

    I've since found that the compose email action is available for the iOS but not for the iBooks author?

  • Cannot download iAd producer

    I am signing in with my apple id after clicking: DOWNLOAD iAd Peoducer 5 now on this page: https://developer.apple.com/iad/iad-producer/ in order to download the iAd producer - and it is taking me to my account settings page and not to the download page.
    no matter what i try - i can't get to the downloader
    please help - thanks!
    Seth

    Did you try contacting Apple using the link in your post?

  • Sliders for iBook's widget built in iAd producer

    I am attempting to build a widget that features sliders (general object) for iBooks in iAd producer. I added sliders in iAd Producer; have a minimum setting of 0.0, maximum of 10, and moving at increments of 0.5. I tested them in the preview funciton in iAd and the knobs on the sliders can be dragged up and down (at increments 0.5 becuase that is what I set it at), but when I export to a widget and drop it into an iBook and preview it, I lose the funciotnality of the knobs in the sliders. I can't drag the knobs back and forth anymore. Does anyone know why? Perhaps I missing an action...?

    Works for me. Have you hooked in any code that may be causing a problem?
    I dropped a slider and a label on a page then selected the slider and clicked the code button then selected to overrride the Did Change Value event handler and added the follwoing code:
    this.onControlValueChange = function (event) {
              // Code here for the "Did Change Value" event.
        var label = this.viewController.outlets.label;
        label.text = this.value;
    I can slide the knob and the label updates as expected.  I did need to tap the widget before I could intereact with it in an iBook but otherwise it works the same for me in an iBook on the device as it does in preview.
    Any other clues?
    -Mark

  • Drag and drop iAd Producer

    hi everyone.
    Anyone can help me with iAd Producer...
    I'm doing widgets for iBooks
    I want to do drag and drop objects, and add some effects  as possible.
    Anyone know how it works?
    Thanks a lot!

    A friend (who is more of a JS jockey than I) created a similar project. Here's how he did it.
    For each draggable object, he added three event handlers:
    Touched Down
    Touch Dragged Inside
    Touched Up Inside
    These can be added by selecting the object and changing the Inspector's INTERACTION > Events brick > + {event} > Execute JavaScript, or by using the menu, Code > Object Events > {event} > Execute JavaScript.
    His code looked something like this:
    // Define CLOSE_X_MIN, CLOSE_X_MAX, CLOSE_Y_MIN and CLOSE_Y_MAX to be
    // "close enough" to the target drop zone.
    this.onViewTouchDragInside = function (event) {
      var p = iAd.Point.fromEventInElement(event, this.layer.parentElement);
      p.x -= this.startTouchPoint.x;
      p.y -= this.startTouchPoint.y;
      p.x += this.startPosition.x;
      p.y += this.startPosition.y;
      this.position = p;
    this.onViewTouchUpInside = function (event) {
      object_pos = this.position
      window.theposition = object_pos;
      var x = object_pos.x;
      var y = object_pos.y;
      if ((x >= CLOSE_X_MIN && x <= CLOSE_X_MAX) && (y >= CLOSE_Y_MIN && y <= CLOSE_Y_MAX)) {
        // close enough, right answer
        x = ((CLOSE_X_MAX + CLOSE_X_MIN) / 2);
        y = ((CLOSE_Y_MAX + CLOSE_Y_MIN) / 2);
        var p = new iAd.Point(x,y);
        this.position = p;
    this.onViewTouchDown = function (event) {
      var p = iAd.Point.fromEventInElement(event, this.layer.parentElement);
      this.startPosition = this.position.copy();
      this.startTouchPoint = p;

Maybe you are looking for

  • How do I turn off the screen lighting at night when bugs are nasty.

    I listen to streaming radio at night, but the computer screen attracts lots of bugs, so very big ones.  How do I dim the screen to zero light?

  • Acct assignment to be restricted based on Doc type

    Dear All I need to restrict Account assignments based on Document types, As of my knowledge there is not standard customizing possible. But i can restrict Acct assignment based on Item catregory. But this settings doesn't satisfy my requirement, I wo

  • How do I disable guest access on E1000?

    I want to disable the guest access connection on E1000 wireless router but this option is not in the firmware menu.  So, now I read that I need to use Cisco Connect on the CD to change this feature.  When I run the Cisco Connect software, it says it

  • Exchange Server 2013 with 3rd party wild Card Certificate shows Invalid

    Hi Team, I've Exchange Server 2013 SP1. Imported a valid 3rd party wild Card Certificate but the status is continuously showing  "Invalid" on all my 2013 servers. Any help? Thank you. Muhammad Nadeem Ahmed Sr System Support Engineer Premier Systems (

  • VB: How do i format two decimal places?

    I'm using VB in Visual Studio 2013. The professor wants the answers from the textboxes to be displayed with dwo decimal places.  all he gave us was the following syntax: format (#,#.00) however i have no idea how to get this to work as i tried to fig