Pages: [1]
  Print  
Author Topic: What is the best way to get a custom attribute of an asset ?  (Read 132 times)
haungo
Gaia User
**
Posts: 39



WWW
« on: July 27, 2011, 10:34:09 AM »

What is the best way to get a custom attribute of an asset?

For Example, here's the XML:
<page id="intro" title="Intro" src="intro.swf" >
   <asset id="introMusic" src="intro_audio.mp3"  _volume=".2" />
</page>

and I want to set the volume of the Sound Asset to the value of the attribute I created as "_volume".

I wish it were as simple as this:
assets.introMusic.volume = assets.introMusic.@_volume ;  //  DOES NOT WORK.


What is the best and proper way to do this?

Thanks in advance,
-HaunGO



Logged

-Trying to find my way through GAIA
haungo
Gaia User
**
Posts: 39



WWW
« Reply #1 on: July 27, 2011, 10:45:55 AM »




ok, so i just needed ".node" and it all works out.

assets.introMusic.node.@_volume

 Wink
Logged

-Trying to find my way through GAIA
Ramiro
Moderator
Gaia Addict
*****
Posts: 861


interactive pragmatism


« Reply #2 on: July 27, 2011, 10:46:49 AM »

Code:
assets.introMusic.volume = assets.introMusic.node.@_volume;
Logged
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 3871


gaiaframework
WWW
« Reply #3 on: July 27, 2011, 11:41:27 AM »

Might want to wrap it in Number() but I guess you don't have to?
Logged

Steven Sacks | Gaia Author
Please support Gaia by donating to the project!  Smiley
Pages: [1]
  Print  
 
Jump to:  

TinyPortal v1.0 beta 4 © Bloc