<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Axelology &#187; Flash</title>
	<atom:link href="http://www.axelscript.com/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.axelscript.com</link>
	<description>Axel Jensen on Flex, Coldfusion and... other stuff</description>
	<lastBuildDate>Mon, 14 Jun 2010 17:30:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>sounds getting cached in IE 6 in flash</title>
		<link>http://www.axelscript.com/2008/02/10/sounds-getting-cached-in-ie-6-in-flash/</link>
		<comments>http://www.axelscript.com/2008/02/10/sounds-getting-cached-in-ie-6-in-flash/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 20:06:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.axelscript.com/2008/02/10/sounds-getting-cached-in-ie-6-in-flash/</guid>
		<description><![CDATA[Site: http://www.sonburst.com/nng/ The application no longer will display the time on the page, it turned to the original request of a progress bar that shows a percentage&#8230;. There are some problems of the page not doing what they want it to, when going back through mp3’s&#8230; the problem has been identified in .mp3 files are [...]]]></description>
			<content:encoded><![CDATA[<p class="body">Site: http://www.sonburst.com/nng/</p>
<p> The application no longer will display the time on the page, it turned to the original request of a progress bar that shows a percentage&#8230;.</p>
<p>There are some problems of the page not doing what they want it to, when going back through mp3’s&#8230; the problem has been identified in .mp3 files are being cached in IE 6.</p>
<p>I&#8217;m currently trying to find a fix for this&#8230; so far, i&#8217;ve tried preventing the page cache using<br />
<cfheader name="Pragma" value="no-cache">     </cfheader></p>
<p>but no luck so far&#8230; when i go into IE, and change my settings to</p>
<p>Tools &gt; Internet Options &gt; (Temporary Internet Files) &gt; Click on Settings &gt; Change the value &#8220;Check for newer versions of stored pages&#8221; to &#8220;every visit to the page&#8221; and then i deleted my files, and refreshed the page, and it worked&#8230;.<br />
<span id="more-35"></span><br />
Still working on a permanent fix, but we&#8217;ve identified the problem.  Used a tool called &#8220;Service Capture&#8221; to find out that it was IE 6 that was doing it&#8230; the problem doesnt seem to be happening in firefox, and that is one of the reasons I never saw it, because my base alpha testing was done in firefox&#8230;.</p>
<p><strong>FOUND THE FIX!</strong></p>
<p class="code">filename = <span style="color: #0000ff">&#8220;sometrack.mp3&#8243;</span><br />
<span style="color: #808080"><em> //the filename is going to be dynamic</em></span><br />
filename = filename + <span style="color: #0000ff">&#8220;?r=&#8221;</span> + Date();<br />
sndAudio.loadSound(filename, true);</p>
<p>NOTE!!!!!!!!<br />
=================<br />
this wont work when you try to trace it, your going to get errors because it&#8217;s not going to run on a webserver&#8230; but when it runs on a webserver it works because the command flash sends understands the querystring&#8230;</p>
<p>WOOOOOOOOOT!</p>
<img src="http://www.axelscript.com/?ak_action=api_record_view&id=35&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.axelscript.com/2008/02/10/sounds-getting-cached-in-ie-6-in-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash URL Encoding</title>
		<link>http://www.axelscript.com/2008/02/10/flash-url-encoding/</link>
		<comments>http://www.axelscript.com/2008/02/10/flash-url-encoding/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 20:03:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.axelscript.com/2008/02/10/flash-url-encoding/</guid>
		<description><![CDATA[This isn&#8217;t perfect, but what i had to do was use the &#8220;escape&#8221; method&#8230;. var artist = &#8220;Set Your Goals&#8221; var album = &#8220;Mutiny!&#8221; var someVar = &#8216;&#60;br&#62; Some Test&#8217; + escape(artist) + &#8216;/&#8217; + escape(album) + &#8216;end&#8217;; This was a workaround for some stuff I do for killtheheart player I haven&#8217;t been able to [...]]]></description>
			<content:encoded><![CDATA[<p class="body">This isn&#8217;t perfect, but what i had to do was use the &#8220;escape&#8221; method&#8230;.</p>
<p class="code">var artist = <span style="color: #0000ff">&#8220;Set Your Goals&#8221;</span><br />
var album = <span style="color: #0000ff">&#8220;Mutiny!&#8221;</span><br />
var someVar = &#8216;<span style="color: #000080">&lt;br&gt;</span> Some Test&#8217; + escape(artist) + &#8216;/&#8217; + escape(album) + &#8216;end&#8217;;<br />
This was a workaround for some stuff I do for</p>
<p><a href="http://beta.killtheheart.com" target="_blank">killtheheart player</a></p>
<p>I haven&#8217;t been able to check it with any of the special characters for usage with xml or anything, but this was a quick save for me.</p>
<img src="http://www.axelscript.com/?ak_action=api_record_view&id=34&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.axelscript.com/2008/02/10/flash-url-encoding/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>working with sound.position in flash 8 actionscript 2</title>
		<link>http://www.axelscript.com/2008/02/10/working-with-soundposition-in-flash-8-actionscript-2/</link>
		<comments>http://www.axelscript.com/2008/02/10/working-with-soundposition-in-flash-8-actionscript-2/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 19:41:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.axelscript.com/2008/02/10/working-with-soundposition-in-flash-8-actionscript-2/</guid>
		<description><![CDATA[there is a known bug in the counter on the quiz app Site: http://www.sonburst.com/nng/ Explanation of Problem: the timer randomly skips seconds Fix: Currently Unknown but working on More InDepth: /* do this to get acutal seconds out of the output which are millisecons */ var pos = Math.round(sound.position/1000); When you output this the seconds [...]]]></description>
			<content:encoded><![CDATA[<p class="body">there is a known bug in the counter on the quiz app</p>
<p>Site:<br />
<a href="http://www.sonburst.com/nng/">http://www.sonburst.com/nng/</a></p>
<p><strong>Explanation of Problem:</strong><br />
the timer randomly skips seconds</p>
<p><strong>Fix:</strong><br />
Currently Unknown but working on</p>
<p><strong>More InDepth:<br />
</strong><font size="1"><em>/*<br />
do this to get acutal seconds out of the output which are millisecons<br />
*/</em></font><br />
var pos = Math.round(sound.position/1000);<br />
<span id="more-32"></span><br />
When you output this the seconds roll along every second in the output panel and look much like this&#8230;<br />
====================<br />
0.334<br />
1.454<br />
2.556<br />
3.662<br />
4.692<br />
====================</p>
<p>and by using the <strong>Math.round</strong> function, it will sometimes end up on a second that is later much like this<br />
====================<br />
0<br />
1<br />
2<br />
3<br />
4<br />
5<br />
<strong><font color="#ff0000">7</font></strong><br />
====================</p>
<p>where you obviously can see 7 should be a 6, but because of the rounding, it rounds up&#8230;. I&#8217;m working on the fix. and heading to the forums.</p>
<img src="http://www.axelscript.com/?ak_action=api_record_view&id=32&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.axelscript.com/2008/02/10/working-with-soundposition-in-flash-8-actionscript-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>flashmatics</title>
		<link>http://www.axelscript.com/2008/02/10/flashmatics/</link>
		<comments>http://www.axelscript.com/2008/02/10/flashmatics/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 19:38:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.axelscript.com/2008/02/10/flashmatics/</guid>
		<description><![CDATA[http://www.flashmatics.co.uk/blog/ this person really knows their stuff&#8230;]]></description>
			<content:encoded><![CDATA[<p class="body"> <a href="http://www.flashmatics.co.uk/blog/" target="_blank">http://www.flashmatics.co.uk/blog/</a></p>
<p> this person really knows their stuff&#8230;</p>
<p><span id="more-31"></span></p>
<img src="http://www.axelscript.com/?ak_action=api_record_view&id=31&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.axelscript.com/2008/02/10/flashmatics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using XML in flash</title>
		<link>http://www.axelscript.com/2008/02/10/using-xml-in-flash/</link>
		<comments>http://www.axelscript.com/2008/02/10/using-xml-in-flash/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 19:15:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.axelscript.com/2008/02/10/using-xml-in-flash/</guid>
		<description><![CDATA[Files: ============ Quiz.fla - Create this file with flash 8. - Create a movie clip and export it for as 2.0 name(mcImage) - Drag that movie clip onto the stage, in the top left corner&#8230; - Create a Layer called &#8220;a&#8221; (actions) open the actions panel, and type the following. #include &#8220;main.as&#8221; #include &#8220;xmlHandler.as&#8221; stop(); [...]]]></description>
			<content:encoded><![CDATA[<p class="body">Files:<br />
============<br />
Quiz.fla<br />
- Create this file with flash 8.<br />
- Create a movie clip and export it<br />
for as 2.0 name(mcImage)<br />
- Drag that movie clip onto the stage,<br />
in the top left corner&#8230;<br />
- Create a Layer called &#8220;a&#8221; (actions) open the actions<br />
panel, and type the following.</p>
<p class="code">#include <span style="color: #0000ff">&#8220;main.as&#8221;</span><br />
#include <span style="color: #0000ff">&#8220;xmlHandler.as&#8221;</span></p>
<p>stop();</p>
<p><span id="more-25"></span><br />
- Create another Layer called &#8220;Questions&#8221;<br />
- This Layer will hold all of the form fields.<br />
- dynamic Text Fields<br />
===================<br />
- tQstnNum<br />
- tQuestion<br />
- lblCorrect<br />
- tAnswerText<br />
- tChcNumber0<br />
- tChcAnswer0<br />
- tChcNumber1<br />
- tChcAnswer1<br />
- tChcNumber2<br />
- tChcAnswer2<br />
- &#8230; all the way till what ever you want&#8230; each<br />
field holds a quetion, and a number of the             the question.</p>
<p>- Buttons<br />
===================<br />
- from the components panel, expand the user<br />
interface, and drag 4 buttons on the stage           &#8211; name the buttons<br />
- btnPrevious<br />
- btnNext<br />
- btnPause<br />
- btnPlay<br />
<a href="http://axelscript.com/wp-content/cfwtExamples/Quiz-Review/index.cfm" target="_blank">View the example</a><br />
<a href="http://axelscript.com/wp-content/cfwtExamples/Quiz-Review/Quiz-Review.zip" target="_blank">Download Files</a><br />
Quiz.xml<br />
===============</p>
<p class="code"><span style="color: #000080">&lt;Quiz&gt;</span><br />
<span style="color: #000080">&lt;question correct=<span style="color: #0000ff">&#8220;&#8221;</span> number=<span style="color: #0000ff">&#8220;&#8221;</span>&gt;</span><br />
<span style="color: #000080">&lt;questionText&gt;</span><span style="color: #000080">&lt;/questionText&gt;</span><br />
&lt;choice&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;&#8221;</span>&gt;&lt;/ChoiceText&gt;<br />
&lt;/choice&gt;<br />
<span style="color: #000080">&lt;sound&gt;</span><span style="color: #000080">&lt;/sound&gt;</span><br />
<span style="color: #008000">&lt;answerText&gt;</span><span style="color: #008000">&lt;/answerText&gt;</span><br />
&lt;jpg&gt;assets/Images/Session1Intro.jpg&lt;/jpg&gt;<br />
<span style="color: #000080">&lt;/question&gt;</span></p>
<p><span style="color: #000080">&lt;question correct=<span style="color: #0000ff">&#8220;A,B,E,F,H,I&#8221;</span> number=<span style="color: #0000ff">&#8220;1&#8243;</span>&gt;</span><br />
<span style="color: #000080">&lt;questionText&gt;</span>Which of the following are rate schedule designations for transportation services offered by Northern?<span style="color: #000080">&lt;/questionText&gt;</span><br />
&lt;choice&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;A&#8221;</span>&gt;TF&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;B&#8221;</span>&gt;TFX&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;C&#8221;</span>&gt;FDD&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;D&#8221;</span>&gt;IDD&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;E&#8221;</span>&gt;GS-T&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;F&#8221;</span>&gt;LFT&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;G&#8221;</span>&gt;PDD&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;H&#8221;</span>&gt;SMS&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;I&#8221;</span>&gt;TI&lt;/ChoiceText&gt;<br />
&lt;/choice&gt;<br />
<span style="color: #000080">&lt;sound&gt;</span>assets/Sounds/SLIDE_01.MP3<span style="color: #000080">&lt;/sound&gt;</span><br />
<span style="color: #008000">&lt;answerText&gt;</span><span style="color: #008000">&lt;/answerText&gt;</span><br />
&lt;jpg&gt;assets/Images/NorthernNaturalGasHeader.jpg&lt;/jpg&gt;<br />
<span style="color: #000080">&lt;/question&gt;</span></p>
<p><span style="color: #000080">&lt;question correct=<span style="color: #0000ff">&#8220;C,D,G&#8221;</span> number=<span style="color: #0000ff">&#8220;2&#8243;</span>&gt;</span><br />
<span style="color: #000080">&lt;questionText&gt;</span>Which of the following are rate schedule designations for storage services offered by Northern?<span style="color: #000080">&lt;/questionText&gt;</span><br />
&lt;choice&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;A&#8221;</span>&gt;TF&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;B&#8221;</span>&gt;TFX&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;C&#8221;</span>&gt;FDD&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;D&#8221;</span>&gt;IDD&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;E&#8221;</span>&gt;GS-T&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;F&#8221;</span>&gt;LFT&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;G&#8221;</span>&gt;PDD&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;H&#8221;</span>&gt;SMS&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;I&#8221;</span>&gt;TI&lt;/ChoiceText&gt;<br />
&lt;/choice&gt;<br />
<span style="color: #000080">&lt;sound&gt;</span>assets/Sounds/SLIDE_02.MP3<span style="color: #000080">&lt;/sound&gt;</span><br />
<span style="color: #008000">&lt;answerText&gt;</span><span style="color: #008000">&lt;/answerText&gt;</span><br />
&lt;jpg&gt;some.jpg&lt;/jpg&gt;<br />
<span style="color: #000080">&lt;/question&gt;</span></p>
<p><span style="color: #000080">&lt;question correct=<span style="color: #0000ff">&#8220;B&#8221;</span> number=<span style="color: #0000ff">&#8220;3&#8243;</span>&gt;</span><br />
<span style="color: #000080">&lt;questionText&gt;</span>TF Service can be purchased for a term of only five months.<span style="color: #000080">&lt;/questionText&gt;</span><br />
&lt;choice&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;A&#8221;</span>&gt;True&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;B&#8221;</span>&gt;False&lt;/ChoiceText&gt;<br />
&lt;/choice&gt;<br />
<span style="color: #000080">&lt;sound&gt;</span>assets/Sounds/SLIDE_03.MP3<span style="color: #000080">&lt;/sound&gt;</span><br />
<span style="color: #008000">&lt;answerText&gt;</span><span style="color: #008000">&lt;/answerText&gt;</span><br />
&lt;jpg&gt;some.jpg&lt;/jpg&gt;<br />
<span style="color: #000080">&lt;/question&gt;</span></p>
<p><span style="color: #000080">&lt;question correct=<span style="color: #0000ff">&#8220;B&#8221;</span> number=<span style="color: #0000ff">&#8220;4&#8243;</span>&gt;</span><br />
<span style="color: #000080">&lt;questionText&gt;</span>TF Service in the Field Area is referred to as:<span style="color: #000080">&lt;/questionText&gt;</span><br />
&lt;choice&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;A&#8221;</span>&gt;TFX&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;B&#8221;</span>&gt;TFF&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;C&#8221;</span>&gt;TXF&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;D&#8221;</span>&gt;TFXF&lt;/ChoiceText&gt;<br />
&lt;/choice&gt;<br />
<span style="color: #000080">&lt;sound&gt;</span>assets/Sounds/SLIDE_04.MP3<span style="color: #000080">&lt;/sound&gt;</span><br />
<span style="color: #008000">&lt;answerText&gt;</span><span style="color: #008000">&lt;/answerText&gt;</span><br />
&lt;jpg&gt;some.jpg&lt;/jpg&gt;<br />
<span style="color: #000080">&lt;/question&gt;</span></p>
<p><span style="color: #000080">&lt;question correct=<span style="color: #0000ff">&#8220;A&#8221;</span> number=<span style="color: #0000ff">&#8220;5&#8243;</span>&gt;</span><br />
<span style="color: #000080">&lt;questionText&gt;</span>Which tier of TF Service has the lowest reservation rate?<span style="color: #000080">&lt;/questionText&gt;</span><br />
&lt;choice&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;A&#8221;</span>&gt;TF12 base&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;B&#8221;</span>&gt;TF12 variable&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;C&#8221;</span>&gt;TF5&lt;/ChoiceText&gt;<br />
&lt;ChoiceText ChoiceID=<span style="color: #0000ff">&#8220;D&#8221;</span>&gt;TFX base&lt;/ChoiceText&gt;<br />
&lt;/choice&gt;<br />
<span style="color: #000080">&lt;sound&gt;</span>assets/Sounds/SLIDE_05.MP3<span style="color: #000080">&lt;/sound&gt;</span><br />
<span style="color: #008000">&lt;answerText&gt;</span><span style="color: #008000">&lt;/answerText&gt;</span><br />
&lt;jpg&gt;some.jpg&lt;/jpg&gt;<br />
<span style="color: #000080">&lt;/question&gt;</span><br />
<span style="color: #000080">&lt;/Quiz&gt;</span></p>
<p>this xml file holds a series of xml questions&#8230;</p>
<p>in the file</p>
<p>main.as<br />
=========</p>
<p class="code">var mcMain:MovieClip = this;</p>
<p>btnNext.onPress = function() {<br />
getNextQuestion();<br />
}</p>
<p>btnPrevious.onPress = function() {<br />
getPreviousQuestion();<br />
}</p>
<p><span style="color: #808080"><em> // declare a new XML instance</em></span> var xmlQuestions:XML = new XML();</p>
<p>function init() {<br />
<span style="color: #808080"><em> // ignore tabs, returns, and other whitespace between nodes</em></span> xmlQuestions.ignoreWhite = true;</p>
<p><span style="color: #808080"><em> // set the scope of the onLoad function to the main timeline, not xmlQuestions</em></span><br />
xmlQuestions.onLoad = Delegate.create(this, onXmlLoaded);</p>
<p><span style="color: #808080"><em> // start loading the file</em></span> xmlQuestions.load (<span style="color: #0000ff">&#8220;Quiz.xml&#8221;</span>);</p>
<p>}</p>
<p><span style="color: #808080"><em> // initialize the xml</em></span> init();</p>
<p>the load of the project is done in the following as file</p>
<p>xmlHandler.xml<br />
==================</p>
<p class="code">function onXmlLoaded(success:Boolean) {<br />
if (success) {<br />
<span style="color: #808080"><em> // trace(&#8216;the xml got loaded successfully&#8217;);</em></span><span style="color: #808080"><em> //set the xml file to be global so we dont have to load it anymore</em></span><span style="color: #808080"><em> //similar to a query of queries in coldfusion.</em></span> _global.xmlQuestions = xmlQuestions</p>
<p>var xnRoot : XMLNode = _global.xmlQuestions.firstChild;<span style="color: #808080"><em> //trace(xnRoot);</em></span><br />
_global.currentQuestion = 0;<br />
_global.recordCount = xnRoot.childNodes.length;</p>
<p>getFirstQuestion();</p>
<p>/******************************<br />
* the following are for the sounds<br />
* ****************************/<br />
} else {<br />
<span style="color: #808080"><em> // do whatever you want to do if an XML read error occurred</em></span> trace(&#8216;xml failed&#8217;)<br />
}<br />
}</p>
<p>function getFirstQuestion():Void {<br />
getQuestionAt(<span style="color: #0000ff">0</span>);<br />
};</p>
<p>function getPreviousQuestion():Void {<br />
<span style="color: #808080"><em> //if it&#8217;s greater than the first record (<span style="color: #0000ff">0</span>) then move to previous&#8230; else&#8230; dont&#8230;</em></span> if (_global.currentQuestion &gt; 0){<br />
<span style="color: #808080"><em> //do manipulation</em></span> tempQuestion = _global.currentQuestion &#8211; 1<br />
getQuestionAt(tempQuestion);<br />
} else {<br />
<span style="color: #808080"><em> //trace (&#8216;at the beginning&#8217;);</em></span><span style="color: #808080"><em> //have to reset the recordCount to &#8211; 1 because of array numbering</em></span> var tempRecordCount = _global.recordCount &#8211; 1<br />
getLastQuestion(tempRecordCount)<br />
};<br />
};</p>
<p>function getNextQuestion():Void {</p>
<p>var tempQuestion = _global.currentQuestion + 1;<br />
<span style="color: #808080"><em> //test to see if we are at the end</em></span> if (tempQuestion &lt; _global.recordCount){<br />
<span style="color: #808080"><em> //do manipulation</em></span> tempQuestion = _global.currentQuestion + 1<br />
getQuestionAt(tempQuestion);<br />
} else {<br />
<span style="color: #808080"><em> //trace (&#8216;at the end&#8217;);</em></span><span style="color: #808080"><em> //have to reset the recordCount to + 1 because of array numbering</em></span> var tempRecordCount = _global.recordCount + 1<br />
getFirstQuestion();<br />
};<br />
};</p>
<p>function getLastQuestion(i:Number):Void {<br />
getQuestionAt(i);<br />
};</p>
<p>function getAllQuestions():Void {</p>
<p>for (var i : Number = 0; i &lt; _global.recordCount; i ++)<br />
{<br />
getQuestionAt(i);<br />
};<br />
};</p>
<p><span style="color: #808080"><em> //getQuestionAt is used by all the other functions! it&#8217;s the main function!</em></span> function getQuestionAt(i:Number):Void {<br />
var xnRoot : XMLNode = _global.xmlQuestions.firstChild;<span style="color: #808080"><em> //trace(xnRoot);</em></span> var xnQuestion : XMLNode = xnRoot.firstChild<span style="color: #808080"><em>;//get Text in Node </em></span> var xnNumber : XMLNode<span style="color: #808080"><em>;//attribute</em></span> var xnCorrect : XMLNode<span style="color: #808080"><em>;//attribute</em></span> var xnChoice : XMLNode<span style="color: #808080"><em>;//next node within question</em></span> var xnChoiceText : XMLNode<span style="color: #808080"><em>;//next node within question</em></span> var xnChoiceTextID : XMLNode<span style="color: #808080"><em>;//attribute of ChoiceText</em></span> var xnSound : XMLNode<span style="color: #808080"><em>;//next node within question</em></span> var xnAnswerText : XMLNode<span style="color: #808080"><em>;//next node within question</em></span> var xnJpg : XMLNode<span style="color: #808080"><em>;//next node within question</em></span></p>
<p>xnQuiz = xnRoot.childNodes [i];<span style="color: #808080"><em>   //trace(xnQuiz);</em></span> xnQuestion = xnQuiz.firstChild;<span style="color: #808080"><em>   // gets all first children</em></span> xnNumber = xnQuiz.attributes.number;<br />
xnCorrect = xnQuiz.attributes.correct;<br />
xnChoice = xnQuestion.nextSibling;<span style="color: #808080"><em>   //trace(xnChoice.childNodes[0]);</em></span><br />
tQstnNum.text = xnQuiz.attributes.number + <span style="color: #0000ff">&#8220;.&#8221;</span>;<br />
tQuestion.text =  xnQuestion.firstChild.nodeValue;<br />
<span style="color: #808080"><em> //trace (xnQuiz.attributes.number + <span style="color: #0000ff">&#8220;. &#8220;</span> + xnQuestion.firstChild.nodeValue);</em></span><span style="color: #808080"><em> //Loop through the choice array\\</em></span></p>
<p>/************************<br />
* declare form fields for array<br />
************************/<br />
var aChoiceNumber = new Array();</p>
<p>aChoiceNumber[0] = tChcNumber0;<br />
aChoiceNumber[1] = tChcNumber1;<br />
aChoiceNumber[2] = tChcNumber2;<br />
aChoiceNumber[3] = tChcNumber3;<br />
aChoiceNumber[4] = tChcNumber4;<br />
aChoiceNumber[5] = tChcNumber5;<br />
aChoiceNumber[6] = tChcNumber6;<br />
aChoiceNumber[7] = tChcNumber7;<br />
aChoiceNumber[8] = tChcNumber8;</p>
<p>var aChoiceAnswer = new Array();</p>
<p>aChoiceAnswer[0] = tChcAnswer0;<br />
aChoiceAnswer[1] = tChcAnswer1;<br />
aChoiceAnswer[2] = tChcAnswer2;<br />
aChoiceAnswer[3] = tChcAnswer3;<br />
aChoiceAnswer[4] = tChcAnswer4;<br />
aChoiceAnswer[5] = tChcAnswer5;<br />
aChoiceAnswer[6] = tChcAnswer6;<br />
aChoiceAnswer[7] = tChcAnswer7;<br />
aChoiceAnswer[8] = tChcAnswer8;</p>
<p>tQuestion.autoSize = true;</p>
<p>tChcAnswer0.autoSize = true;<br />
tChcAnswer1.autoSize = true;<br />
tChcAnswer2.autoSize = true;<br />
tChcAnswer3.autoSize = true;<br />
tChcAnswer4.autoSize = true;<br />
tChcAnswer5.autoSize = true;<br />
tChcAnswer6.autoSize = true;<br />
tChcAnswer7.autoSize = true;<br />
tChcAnswer8.autoSize = true;</p>
<p>for (var j : Number = 0; j &lt; xnChoice.childNodes.length; j ++)<br />
{<br />
xnChoiceText = xnChoice.childNodes[j];<br />
xnChoiceTextID = xnChoiceText.attributes.ChoiceID;<span style="color: #808080"><em>   //trace(xnChoiceID);</em></span><br />
aChoiceAnswer[j].text = xnChoiceText.firstChild.nodeValue;<br />
aChoiceNumber[j].text = xnChoiceTextID + <span style="color: #0000ff">&#8220;.&#8221;</span>;</p>
<p>for (var k : Number = xnChoice.childNodes.length;k &lt; aChoiceAnswer.length; k++)<br />
{<br />
aChoiceAnswer[k].text = <span style="color: #0000ff">&#8220;&#8221;</span>;<br />
aChoiceNumber[k].text = <span style="color: #0000ff">&#8220;&#8221;</span>;<br />
}</p>
<p><span style="color: #808080"><em> //trace(xnCorrect + <span style="color: #0000ff">&#8221; vs. &#8220;</span> + xnChoiceTextID);</em></span><span style="color: #808080"><em> //trace (<span style="color: #0000ff">&#8221;   &#8220;</span> + xnChoiceTextID + <span style="color: #0000ff">&#8220;. &#8220;</span> + xnChoiceText.firstChild.nodeValue);</em></span> };</p>
<p>xnSound = xnChoice.nextSibling;<span style="color: #808080"><em> //trace (<span style="color: #0000ff">&#8220;Sound: &#8220;</span> + xnSound.firstChild.nodeValue);</em></span> xnAnswerText = xnSound.nextSibling;<br />
lblCorrect.text = <span style="color: #0000ff">&#8220;Answer: &#8220;</span> + xnCorrect;<br />
<span style="color: #808080"><em> //tAnswerText.text = xnAnswerText.firstChild.nodeValue; //trace (<span style="color: #0000ff">&#8220;AnswerText: &#8220;</span> + xnAnswerText.firstChild.nodeValue);</em></span><br />
xnJpg = xnAnswerText.nextSibling;<span style="color: #808080"><em> //trace (<span style="color: #0000ff">&#8220;Image: &#8220;</span> + xnJpg.firstChild.nodeValue);</em></span><br />
mcImage.loadMovie(xnJpg.firstChild.nodeValue,<span style="color: #0000ff"> 5</span>);</p>
<p>_global.currentQuestion = i;<span style="color: #808080"><em> //set the new current question</em></span> loadMP3(xnSound.firstChild.nodeValue);<br />
};</p>
<p>function loadMP3(filename:String):Void{<br />
this.createEmptyMovieClip(<span style="color: #0000ff">&#8220;mcSoundHolder&#8221;</span>, this.getNextHighestDepth());<br />
sndAudio = new Sound(mcSoundHolder);<br />
sndAudio.loadSound(filename, false);</p>
<p>sndAudio.onLoad = function(bSuccess:Boolean):Void {<br />
if(bSuccess){<br />
sndAudio.start();<br />
} else {<br />
trace(&#8216;there was an error opening the file&#8217;);<br />
};<br />
};</p>
<p>var nInterval:Number = setInterval(checkProgress,<span style="color: #0000ff">1000</span>);<br />
function checkProgress():Void{<br />
var nPercent:Number = Math.round((sndAudio.getBytesLoaded()/sndAudio.getBytesTotal()) * 100);<br />
<span style="color: #808080"><em> //trace(nPercent);</em></span> };</p>
<p>/*********************************<br />
* the play and pause or any other sound buttons must go within the loadMP3() function<br />
* *******************************/<br />
btnPlay.onPress = function() {<br />
sndAudio.start(sndAudio.position/1000);<br />
};</p>
<p>btnPause.onPress = function() {<br />
sndAudio.stop();<br />
};</p>
<p>};</p>
<img src="http://www.axelscript.com/?ak_action=api_record_view&id=25&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.axelscript.com/2008/02/10/using-xml-in-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the Object dumper in flash actionscript 2.0</title>
		<link>http://www.axelscript.com/2008/02/10/using-the-object-dumper-in-flash-actionscript-20/</link>
		<comments>http://www.axelscript.com/2008/02/10/using-the-object-dumper-in-flash-actionscript-20/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 19:11:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.axelscript.com/2008/02/10/using-the-object-dumper-in-flash-actionscript-20/</guid>
		<description><![CDATA[The object dumper is a great way to open up and get more feedback out of the object instead of for instance: [Object Object] This is the blog i got it from THANK YOU! import mx.data.binding.ObjectDumper; trace(ObjectDumper.toString(_global)); This is fantastic! thank you Jen deHaan]]></description>
			<content:encoded><![CDATA[<p class="body">The object dumper is a great way to open up and get more feedback out of the object instead of for instance:</p>
<p> [Object Object]</p>
<p><a href="http://weblogs.macromedia.com/dehaan/archives/2005/04/hidden_componen.cfm">This is the blog i got it from THANK YOU!</a></p>
<p class="code">import mx.data.binding.ObjectDumper;</p>
<p>trace(ObjectDumper.toString(_global));</p>
<p>This is fantastic! thank you Jen deHaan</p>
<p><span id="more"></span></p>
<img src="http://www.axelscript.com/?ak_action=api_record_view&id=24&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.axelscript.com/2008/02/10/using-the-object-dumper-in-flash-actionscript-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
