I’m thinking of a re-design…

24
Jun/09
4

I’ve been tossing some ideas around and think I came up with a pretty good concept…let me know what you think.

Filed under: not work

Line breaks in XML

17
Jun/09
1

When importing textual data into Flash via XML, some quirky things can happen regarding line breaks. Many people suggest using return characters (“\n”), line breaks (“<br>”), putting everything inside of a CDATA (<[CDATA[<br>]]>) etc. All of which yield different, and often undesirable results.

One solution that does work is using the character data for a line break. According to section 5.2 of the W3C Canonical XML specifications: (edited slightly to show only relevant information)

The XML 1.0 specification requires XML processors to perform certain simple transformations on white-space characters in XML documents, when they serve as line separators and when they appear in attribute values. The Information Set describes the resulting set of characters that are considered to be part of the document. For example, in an XML 1.0 document:

  • Where two lines are separated by CR-NL (#xD, #xA), the information set contains a single NL (#xA) character.
  • Where a document contains the string "&#x13;", the information set contains a single CR (#xD) character.

In Canonical XML, all characters from the information set appearing in character data or attribute values are represented by their UTF-8 encoding, with the following exceptions:

  • In character data, the carriage-return (#xD) character is represented by "&#xD;".
  • In attribute values, the characters TAB (#x9), linefeed (#xA), and carriage-return (#xD) are represented by "&#x9;", "&#xA;", and "&#xD;" respectively.

So basically, the easiest way to put a line break into your XML text is to use "&#xD;"

Example:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<books>
    <book>
	<Name>
	    Great Expectation
	</Name>
	<Author>
	    Charles Dickens
	</Author>
	<Info>
	    Publish Date: 1860 &#xD;Pages: 799 &#xD;Country: England
	</Info>
    </book>
</books>

Filed under: work

Tippmann releases Project Salvo™ and TPX™

12
Jun/09
1

salvo_markerTippmann sports released 2 new guns over the past couple weeks, the Project Salvo and the TPX pistol. Both guns look totally sweet and so far are receiving great reviews. Check out the YouTube review from the Wolf’s Den.

Also be sure to keep your eye out on the Tippmann Web site for new additions, especially if you like, or want to learn how to take care of and modify your own marker.

Filed under: not work

Embedded YouTube z-index Issue

8
Jun/09
15

overlapEmbedding a YouTube video on your website seems like a no-brainer. And it is…I’m sure anybody with a brain can figure it out.

However, some specific situations may arise, as in my case, where the embedding of the video goes smoothly, but other things on your site may be affected by it, like an absolutely positioned drop-down navigation menu. (see figure 1)

Now, my initial diagnosis was simply to change the z-index of the navigation as well as the div containing said YouTube video. So minutes upon minutes of changing positions, z-indexes, etc. I decided to turn my efforts to the universal question answerer…Google.

After minutes of searching, I found a useful link here. As a result of adding the parameter “wmode” and setting it to “opaque” makes it work. (see figure 2)

no_overlapSo take heed when embedding YouTube videos onto your bliggidy-blogs, or facey-spaceys’ or tweety-pages and make sure it’s not going to break anything. Below is a code sample of what you will need.

<object width="460" height="307" VIEWASTEXT>
	<param name="movie" value="src="YOUR_YOUTUBE_URL_HERE""></param>
	<param name="allowFullScreen" value="true"></param>
	<param name="allowscriptaccess" value="always"></param>
	<param name="wmode" value="opaque" />
	<embed src="YOUR_YOUTUBE_URL_HERE"
		type="application/x-shockwave-flash"
		allowscriptaccess="always"
		allowfullscreen="true"
		width="460"
		height="307"
		wmode="opaque">
	</embed>
</object>
Filed under: work

XML Video Chooser with ComboBox Component

2
Jun/09
2

Here is a quick and dirty way for you to create a drop-down with multiple videos that update an FLVPlayback component with titles and paths loaded from an external XML file. Example XML is below the code. Enjoy!

import fl.data.DataProvider; 

var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, getXML);
var videosXML:XML; 

function getXML(e:Event):void {
    videosXML = new XML(e.target.data);
    var videos:Array = new Array({label:"Select a Video",data:""});
    for each (var video:XML in videosXML.video) {
      videos.push({label:video.Title.toString(),data:video.Path.toString()});
    }
   cb_vids.dataProvider = new DataProvider(videos);
} 

cb_vids.addEventListener(Event.CHANGE, changeHandler);
    function changeHandler(event:Event):void {
    if (ComboBox(event.target).selectedItem.data != "") {
	vid_holder.myVideo.source = ComboBox(event.target).selectedItem.data;
    }
} 

xmlLoader.load(new URLRequest("videos.xml"));
Example XML file:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<videos>
	<video>
	  <Title>This is the first video</Title>
	  <Path>video_1.flv</Path>
	</video>

	<video>
	  <Title>This is the second video</Title>
	  <Path>video_2.flv</Path>
	</video>

	<video>
	  <Title>This is the third video</Title>
	  <Path>video_3.flv</Path>
	</video>
</videos>
Filed under: work