This is my first post on the new forums, so I'll say now, nice job guys. Looks nice!
... now on with my questions...
I'm simply trying to add an attribute into the root <sco> tag. I can get it working on the "Edit Project" screen (default.fla) however the same component does not work on the "Publish Course" (Publish Settings (publish.fla) screen. I thought it might be one of the callback functions I need to use, however I can't find documentation on them.
Which kind of leads me to my second question:
What's the purpose/difference between the functions:
- getField(componentName)
- buildField(componentName)
- updateField(componentName)
I understand that the "getField" gets the component fields' value, the "buildField" probably builds it and the "updateField" updates it with the value from the XML attribute (for example). :)
I know it's something small (and this gave me a chance to check out the new forum too).
Thanks in advance,
Brandon
Tags: components, sco, xml
Permalink Reply by Steven Hancock on February 21, 2012 at 2:54pm Hi Brandon,
When trying to get a component to work in a given form, I have found the best way is to copy a component already used in that form or to copy the settings from another component already used in that form. Perhaps you have already tried to do that.
Now to your question. getField does indeed grab the value of the field. updateFields updates that value. buildField is one that I am not familiar and so I am checking on that one.
Thanks,
Steve
Permalink Reply by Brandon Good on February 22, 2012 at 5:54am Hi Steve, that's how I've handled all the rest of the components that I've moved around or added, but this one is different. I've tried a few different combinations using the three functions I mentioned and none have worked so far.
The prefix for the aforementioned fuctions is: _root.main ie: _root.main.updateField()
Thanks.
Permalink Reply by Brandon Good on February 22, 2012 at 6:59am Sorry, I guess I should've added that I was trying to use a checkbox component, although I did try a dropdown one too.
B.
Permalink Reply by Steven Hancock on February 22, 2012 at 9:29am It may not be the component so much as the form you are adding it to. There may be some limitation to the publish page and its intent. Because it is building the final project, there may be some timing issues between adding data to the XML file and finalizing it.
Could you place the data in the edit project settings area?
Permalink Reply by Brandon Good on February 22, 2012 at 9:35am I can place the component within the "Project Settings" area and have it write to the XML as expected.
My original guesttimation is that under the "Publish Course" form, the main shell (through Zinc?) wasn't expecting/listening for any additional info except for what was there already and therefore wasn't writing to the XML. I even tried duplicating the drop-down at the top of the "Publish Course" screen that controls whether the LO is published for Non-LMS, CDRom, SCORM, etc to see if I could resuse that to do my bidding (of course chaging the instance name and attribute properties respectively) but it doesn't recognize that either.
Logically, my users would look for this setting I'm adding under the "Publish Course" form.
Thanks again for your help.
Brandon
Permalink Reply by Steven Hancock on February 22, 2012 at 9:26am Hi Brandon,
When trying to get a component to work in a given form, I have found the best way is to copy a component already used in that form or to copy the settings from another component already used in that form. Perhaps you have already tried to do that.
Now to your question. getField does indeed grab the value of the field. updateFields updates that value. buildField is one that I am not familiar and so I am checking on that one.
Thanks,
Steve
© 2012 Created by Rapid Intake, Inc.
