forked from: SO randomize venue

by pleclech forked from SO randomize venue (diff: 28)
♥0 | Line 62 | Modified 2012-12-20 23:10:19 | MIT License
play

ActionScript3 source code

/**
 * Copyright pleclech ( http://wonderfl.net/user/pleclech )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/hrtg
 */

// forked from pleclech's SO randomize venue
package {
    import flash.events.MouseEvent;
    import flash.utils.setTimeout;
    import com.bit101.components.TextArea;
    
    public class FlashTest extends TextArea {
        public function FlashTest() {
            width=400
            height=400
            setTimeout(doTest, 500)                        
        }
        
        public function FisherYatesShuffle(array:Array):void {            
        }

        public function doTest():void {
            try {
                trace("--- click me ---");
                var xml:XML = <gallery>
<venue name='1'>
        <name><![CDATA[hello]]></name>
        <description>1</description>
        <picture>images/1.jpg</picture>
        <thumb>thumbs/1.jpg</thumb>
        <address>1</address>
        <website>http://1.co.uk</website>
</venue>

<venue name='2'>
        <name>2</name>
        <description>2</description>
        <picture>images/2.jpg</picture>
        <thumb>thumbs/2.jpg</thumb>
        <address>2</address>
        <website>http://2.co.uk</website>
</venue>

<venue name='3'>
        <name>3</name>
        <description>3</description>
        <picture>images/3.jpg</picture>
        <thumb>thumbs/3.jpg</thumb>
        <address>3</address>
        <website>http://3.co.uk</website>
</venue>

<venue  name='4'>
        <name>4</name>
        <description>4</description>
        <picture>images/4.jpg</picture>
        <thumb>thumbs/4.jpg</thumb>
        <address>4</address>
        <website>http://4.co.uk</website>
</venue>

</gallery>;
//trace(xml);
var toto:String="toto le roi du monde";
trace(xml.venue.(@name=='1').name=<name><![CDATA[{toto}]]></name>);
trace(xml.venue.name);
trace(xml);
            } catch (e:*) {
                trace(e);
            }
        }

        public function trace(...args):void {
            text=text+args.join(", ")+"\n"
        }
    }
}

Forked