[Xerte] setting id

Dave Burnett d_b_burnett at hotmail.com
Fri Jul 23 23:55:38 BST 2010


if (doneOnce != true){
  icon.nextSibling.lastChild.duplicate(menuData.menu_item.length - 1);
}


for (i = 0; i < menuData.menu_item.length; i++) {
  icon.nextSibling.childNodes[i].childNodes[0].attributes.id = 'dave_' + i;
}


I thought that was what I was doing.

The id queries all register that the id is set to what I would expect from the above, but this is the problem:
If I do not assign ID's to the target, and leave them as the ID in the proto, this triggers the last created page:

sameIDs.onRelease();

If I assign discrete ID's as per for (i above:

dave_2.onRelease();
does not function.

:-/



________________________________
> Subject: RE: [Xerte] setting id
> Date: Fri, 23 Jul 2010 20:53:43 +0100
> From: Julian.Tenney at nottingham.ac.uk
> To: xerte at lists.nottingham.ac.uk
>
>
>
> after duplicating, you then need to loop over the cml nodes and set attributes.id, so that when the xml gets parse, it creates unique IDs on the icons,
>
> icon.nextSibling.duplicate(n);
>
> for (i = 0; i < n; i++){
> icon.parentNode.childNodes[i+1].attributes.id = 'ic'+i;
> }
>
> //something like that.
>
> There's no need to set IDs on icons once they exist - if you need similar icons to have unique IDs, do this,
>
> ________________________________
> From: xerte-bounces at lists.nottingham.ac.uk on behalf of Paul Swanson
> Sent: Fri 23/07/2010 18:17
> To: Xerte discussion list
> Subject: RE: [Xerte] setting id
>
>
> It should be possible to create unique IDs when duplicating. Would
> something like the following work if entered as the id property?
>
> myId + iconParent.repCount
>
> If my syntax is correct, you should end up with different IDs for each
> page of the decision icon: myId1, myId2, etc.
>
>> -----Original Message-----
>> From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-
>> bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
>> Sent: Friday, July 23, 2010 10:03 AM
>> To: Xerte list
>> Subject: RE: [Xerte] setting id
>>
>>
>>
>> Hmm, no mention of setProperty in the archives.
>> Maybe no one uses it. ;-)
>>
>> OK, the underlying issue is this:
>>
>> I duplicate 5x a page of objects along a decision icon, they all end
> up
>> with the same ID
>>
>> Once that is set up I would like to trigger the first leg by code.
>>
>> sameID.onRelease();
>> always triggers the last leg of the duped items.
>>
>> Way round it?
>>
>> Dave
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ________________________________
>>> From: maryann at moberg.com
>>> Date: Fri, 23 Jul 2010 11:59:30 -0400
>>> Subject: Re: [Xerte] setting id
>>> To: xerte at lists.nottingham.ac.uk
>>>
>>> Here's the flash documentation for setProperty - a movie clip
>> function. Is this what you had in mind?
>>>
>>>
>>>
>>>
>>>
>>> setProperty(target:Object,
>>> property:Object, expression:Object) : Void
>>>
>>>
>>>
>>> Changes a property value of a movie clip as the movie clip plays.
>>>
>>>
>>>
>>> Availability: ActionScript 1.0; Flash Player 4
>>>
>>>
>>> Parameters
>>>
>>>
>>>
>>>
>>>
>>> target:Object - The path to the instance
>>> name of the movie clip whose property is to be set.
>>>
>>> property:Object - The property to be set.
>>>
>>>
>>>
>>> expression:Object - Either the new literal value
>>> of the property, or an equation that evaluates to the new value of
>> the
>>> property.
>>>
>>>
>>> Example
>>>
>>>
>>>
>>> The following ActionScript creates a new movie clip and loads an
>> image into
>>> it. The _xand
>>> _y
>>> coordinates are set for the clip using setProperty(). When you click
>>> the button called right_btn, the _x coordinate of a movie clip
>>> named params_mc
>>> is incremented by 20 pixels.
>>>
>>>
>>>
>>> this.createEmptyMovieClip("params_mc", 999);
>>>
>>>
>>
> params_mc.loadMovie("http://www.helpexamples.com/flash/images/image1.jp
>> g");
>>>
>>>
>>>
>>> setProperty(this.params_mc, _y, 20);
>>>
>>> setProperty(this.params_mc, _x, 20);
>>>
>>> this.right_btn.onRelease = function() {
>>>
>>>
>>>
>>> setProperty(params_mc, _x, getProperty(params_mc, _x)+20);
>>>
>>> };
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Fri, Jul 23, 2010 at 11:25 AM, Dave Burnett> wrote:
>>>
>>>
>>>
>>>
>>>
>>>
>>> I'm having another of my noticeably more frequent senior moments.
>>>
>>> At least I'll get half-price at the buffet soon...
>>>
>>>
>>>
>>>
>>>
>>> icon.previousSibling.clip().getProperty('id')
>>>
>>>
>>>
>>> What's the syntax to set this same property?
>>>
>>>
>>>
>>> Thnx.
>>>
>>>
>>>
>>> Dave
>>>
>>>
>>>
>>>
>>>
>>> _________________________________________________________________
>>>
>>> Hotmail is redefining busy with tools for the New Busy. Get more
> from
>> your inbox.
>>>
>>>
>>
> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL
>> :ON:WL:en-
>> US:WM_HMP:042010_2_______________________________________________
>>>
>>>
>>>
>>> Xerte mailing list
>>>
>>> Xerte at lists.nottingham.ac.uk
>>>
>>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>>>
>>>
>>
>> _________________________________________________________________
>> The New Busy is not the too busy. Combine all your e-mail accounts
> with
>> Hotmail.
>>
> http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=P
>> ID28326::T:WLMTAGL:ON:WL:en-
>> US:WM_HMP:042010_4_______________________________________________
>> Xerte mailing list
>> Xerte at lists.nottingham.ac.uk
>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>
>
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
 		 	   		  
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1


More information about the Xerte mailing list