Yoga video for neck and shoulder
December 9th, 2009 by xmlflashHere is the video of Yoga for the neck and shoulder. Below is the video I got. It is not difficult. Just keep up.
Here is the video of Yoga for the neck and shoulder. Below is the video I got. It is not difficult. Just keep up.
Here is the solution of inserting HTML formatted text into your Flash files through XML:
In your XML add your HTML data like this:
<htmlData><![CDATA[ Here is my <br/> html text ]]></htmlData>
As a note, you can’t insert your HTML data into an XML attribute.
In your Flash file do something similar to this:
xml = new XML();
xml.ignoreWhite = true;
xml.load(”myXMLfile.xml”);
xml.onLoad = function () {
txt = createTextField(”txt”, 0, 0, 0, 0, 0);
txt.html = true;
txt.htmlText = xml.firstChild.nodeValue;
}
XML can be much more complicated than just text. Now, all you need to think of it as being. As such, the big comparison you can make with XML is to urlencoded text which you can load into Flash to obtain external text variables; this via the LoadVars object (or using loadVariables). The XML object in Flash, the ActionScript construct used to load and manage XML, is very similar to the LoadVars object used for urlencoded text variables. Lets take a look at an example of urlencoded text so that we can make a quick comparison between it and XML:
subject=Flash in the News&date=07.25.04&body=Macromedia just announced their support for flashers around the world, those with overcoats and those without.&
The above shows a urlencoded string that would be contained in a text file - a text file which can be loaded into and utilized by Flash. When this happens (via a LoadVars instance), you get 3 variables: subject, date, and body with their respectively assigned strings as values. It’s pretty simple and straight forward. You have your basic variable string defined with equal signs (=) and separated with ampersands (&). Not too hard to follow, right? A respective XML file may look like following:
<news>
<entry date=”07.25.04″>
<subject>Flash in the News</subject>
<body>
Macromedia just announced their support for flashers around the world; those with overcoats and those without.
</body>
</entry>
</news>
The above consists of the same content as the variable string before. Only this time, as XML, it’s just laid out a little differently and is organized using tags (XML elements). This, as you can probably tell (color coding aside), makes it a little easier to follow compared to the variable string. It may be a little longer, and thereby requiring slightly more hard drive space to store and making for slightly more bandwidth consumption, but the added clarity is definitely an improvement over the previous format.
When this is brought into Flash, however, you get more than just three simple variables like those which you get with the variable string. Instead, you have a complex data object (contained within an instance of the XML object) harboring not only the content but also the structure of the XML and the hierarchy that defines it. And that is where XML gets scary and confusing. Because it’s a markup language, you get that added structure intertwined in with your data.
Why struggle with all that mess while you can have three simple variables? Given the example above, it would certainly be easier to use a variable string and LoadVars. Structure and organization may suffer, but that particular instance doesn’t really use much of it, right? There are many cases where that is right, where variable strings may be advantageous over XML. These include cases where structure may be irrelevant or where you’re dealing with fairly simple, straight-forward data that wouldn’t be all that confusing as a variable string. The key elements that XML offers are Structure and clarity for text-based data. Given the circumstances of your situation, you will need to decide whether or not your data requires this or whether you might be better off just using urlencoded variables. You get more speed with the variables but you lose structure and clarity XML provides that structure and clarity but can take longer to load depending on that structure and takes extra effort to parse when interpreted into usable data.
Do you have any idea about XML in Flash? What’s the big deal about XML in Flash? There is no big deal at all. You can just take it into two word, XML, and Flash.
There is no huge bond or special relation that the two entities have with each other. Flash does, however, provide you with a simple means of collecting data from an XML source and interpreting it in a way that can be understood in ActionScript. Simply, you’ve got yourself a way of loading information into Flash.
It’s easy to get carried away with the current buzz surrounding XML at this point as it’s becoming so widely used for so many things. When it comes down to Flash, and in the simplest terms, all you get in the end is just some formatted text that you can load into Flash during runtime. Not to say that’s a bad thing. No, not at all. And XML is good, but it can easily be touted to be more than it really is. So before you get too excited, realize that this is not rocket science; its just text and Flash loading it in.
If you want to use XML to load data into Flash, you shall figure out how exactly that XML file makes it there and what commands are needed to make it happen. It sounds a little bit difficult, but it actually isn’t. If you’ve ever loaded in a variable string with loadVariables then you’ve pretty much already loaded XML too. It’s the exact same proces.
It mainly revolves 2 function in loading XML. One of these functions is a pre-existing function that you simply call yourself. However, the other is a callback function that you have to define which will automatically be called by Flash depending on the occurrence of a certain event. The event we’re dealing with here is the event of the XML being fully downloaded and introduced into Flash movie. This is the called the onLoad event.
Each of of these functions are used on an XML instance. XML instances are created using the XML object, or class, and provide a construct in Flash that lets you manage your XML. If you’re working at all with XML in Flash, then you’re pretty much guaranteed to be using an XML instance.
So first, before anything, when loading XML into Flash, you have to create that XML instance. The XML instance for this example, and most you will see from now on despite the fact that naming is arbitrary, will be called “my_xml.” Note: using “_xml” at the end of your XML variable name in Flash MX or MX04 will give you code hints. In MX04, typing a new XML instance will provide hints without the suffix (i.e. var life:XML = new XML(); suffices).
var my_xml = new XML();
In creating an XML instance in this manner, you do have the option of passing in an XML string to the XML constructor (the constructor being the function that creates the XML, here new XML()). That string would consist of XML which will be immediately defined within the XML instance created. For example:
var my_xml = new XML(”<some>stuff</some>”);
Though, when about to load in external XML, there’s really no point since whenever you load XML into an XML instance in Flash, all XML contained within that instance is replaced with that which is loaded. Passing text like that is optional, so for this example it will just be omitted.
Once an instance exists, you can define the onLoad callback function. The callback function, whenever you make it, always has to be called onLoad. Just like other event handlers, this is how Flash knows to call it when its needed, i.e. when the XML content has been loaded and parsed. Additionally, a success argument is passed into each onLoad when it fires. This will let you know if your XML has actually successfully loaded or not. For example, when you try to load XML from the URL “http://get a life,” success will be false - “http://get a life” is obviously not a valid URL (hey, we all have lives here!). However, use a valid url (with a rock-solid internet connection) and success will be true signifying the completion of XML being loaded into Flash and ready for use.
Here, we’ll make an onLoad function that simply traces the XML object when successfully loaded. Tracing an XML object directly will reveal the XML in text format.
var my_xml = new XML();
my_xml.onLoad = function(success){
if (success){
trace(this);
}
}
Since onLoad is defined in the XML instance, this inside the function references the instance directly.
Now that the onLoad has been defined, it’s now time to request the XML to load in an external XML document. This is handled through the load method, the second of the 2 functions. The load method accepts one argument, the external XML document’s URL (this can be relative or absolute).
var my_xml = new XML();
my_xml.onLoad = function(success){
if (success){
trace(this);
}
}
my_xml.load(”my_document.xml”);
Now, supposing my_document.xml contained the following:
<myxml>
I can load XML like the wind!
</myxml>
When the ActionScript above is run and the XML is loaded, you would receive a trace that would resemble the following.

Bear in mind that the XML does have to load into Flash. This is not an immediate process. It takes time, often many seconds or Flash frames before any of the loaded XML is accessible through the XML instance. This means that any attempt to access that information in the same script which the load method is used will end in failure. That is, of course, unless you do so within the onLoad function. Though the onLoad is defined in the same script as everything else, it doesn’t actually get executed until the XML is fully loaded and parsed - some time after the rest of the script has already completed running, So, in other words, don’t do this:
var my_xml = new XML();
my_xml.onLoad = function(success){
if (success){
trace(this);
}
}
my_xml.load(”my_document.xml”);
trace(my_xml); <- too early, not loaded yet
It’s in the onLoad function where you pretty much do everything it is you need to do with your loaded XML content. You need it to populate a menu? Do it in the onLoad. Want to display your family tree? Do it in the onLoad (someone has to have a nice XML family tree floating around). The onLoad is the key to handling loaded XML since it is at that point you actually have access to it. Anywhere else and you just may not have any XML to reference.
XML, standing for Extensible Markup Language, is a general-purpose specification for creating custom markup languages. It is classified as an extensible language, because it allows the user to define the mark-up elements. XML is designed to help information systems in sharing structured data, especially via the Internet, to encode documents, and to serialize data; in the last context, it compares with text-based serialization languages such as JSON, YAML, and S-Expressions.
XML is recommended by the World Wide Web Consortium (W3C). It is a fee-free open standard. The recommendation specifies lexical grammar and parsing requirements. XML’s set of tools helps developers in creating web pages but its usefulness goes well beyond that. XML, in combination with other standards, makes it possible to define the content of a document separately from its formatting, making it easy to reuse that content in other applications or for other presentation environments. Most importantly, XML provides a basic syntax that can be used to share information between different kinds of computers, different applications, and different organizations without needing to pass through many layers of conversion.
XML began as a simplified subset of the Standard Generalized Markup Language (SGML), meant to be readable by people via semantic constraints; application languages can be implemented in XML. These include XHTML, RSS, MathML, GraphML, Scalable Vector Graphics, MusicXML, and others. Moreover, XML is sometimes used as the specification language for such application languages.