Viewer XML in Flash

Hello

Would like to know is possible view xml online. I'm looking for something like the view XML browser inside the application. I use CS6 AS3.

If you mean display XML format way, the bad news is that there is no free code available that will accomplish everything you need.

The good news is that it is possible to write your own application and it is not so difficult.

To colorize text the best way is to use regular Expressions in the method withTextField.setTextFormat () of conjunction. The trick is to identify patterns of chain to cover all the functionality of possible XML parts.

The code following applies color to the different parts of a sample XML - do just this class of the your document class if you use Flash IDE.

As far as minimizing/maximizing goes - it's a more complex process although it is at hand with a little effort and some basic knowledge of the AS3 display list model.

package
{
          import flash.display.Sprite;
          import flash.text.TextField;
          import flash.text.TextFormat;

          public class XMLViewer extends Sprite
          {
                    private var xml:XML;
                    private var textField:TextField;

                    public function XMLViewer()
                    {
                              init();
                    }

                    private function init():void
                    {
                              writeXML();
                              displayXML();
                    }

                    /**
                     * Creates a TextField instance for displaying XML string
                     */
                    private function displayXML():void
                    {
                              textField = new TextField();
                              textField.defaultTextFormat = new TextFormat("Arial", 12);
                              textField.multiline = true;
                              textField.autoSize = "left";
                              textField.text = xml.toXMLString();
                              addChild(textField);
                              formatText();
                    }

                    private function formatText():void
                    {
                              var xmlString:String = xml.toXMLString();
                              var format:TextFormat = new TextFormat("Arial", 12, 0x0000FF);
                              // format brackets
                              applyFormat(format, /[\<\>\=\/\"]/g);
                              // format tags
                              format.color = 0xA05050;
                              applyFormat(format, /\w+/g);
                              // format values
                              format.color = 0x000000;
                              format.bold = true;
                              applyFormat(format, /(?<=\")[\w\s]+(?=\")|(?<=\>)[\w\s]+(?=\<)/g);
                              // format CDATA
                              format.color = 0x0000FF;
                              format.bold = false;
                              applyFormat(format, /(\<\!\[CDATA\[)|(\]\])/g);
                              // format CDATA content
                              format.color = 0x000000;
                              format.bold = false;
                              applyFormat(format, /(?<=CDATA\[).+(?=\]\])/g);
                    }

                    /**
                     * Applies format to textField instance based on format and regular expression arguments
                     * @param          format
                     * @param          re
                     */
                    private function applyFormat(format:TextFormat, re:RegExp):void
                    {
                              var string:String = textField.text;
                              var result:Object = re.exec(string);
                              while (result != null)
                              {
                                        var index:int = result.index;
                                        textField.setTextFormat(format, index, index + result[0].length);
                                        result = re.exec(string);
                              }
                    }

                    /**
                     * Just composes sample XML
                     */
                    private function writeXML():void
                    {
                              xml =   
                                                  
                                                  
                                                  
                                                            Novel 1 description
                                                  
                                                  here we go ]]>
                                        ;
                    }

          }

}

Tags: Adobe Animate

Similar Questions

  • I get this message: DNS server is not responding. Cannot view XML input using XSL style sheet.

    My problem was caused by using McAfee. The only way I can connect to the internet is if I start my computer in "safe mode". I've since removed McAfee from my computer, but I can't always connect to internet in normal startup mode. When I run a diagnosis, I get the message: "DNS server is not responding" & "cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button. »

    On the recommendation of MS tech support, I already tried

    1. perform a clean boot

    2. reset internet Explorer

    3 typeing these orders in the dark of the screen then restart the computer after you perform these steps

    b. Netsh int tcp reset

    c. Netsh int ipv4 reset

    zero i. (XP) netsh int ip reset

    d. Netsh winsock reset

    e. Netsh winhttp reset proxy

    f. Netsh advfirewall reset

    g. Ipconfig/flushdns

    h. Ipconfig/Release

    i. Ipconfig / renew

    j. Ipconfig/registerdns

    None of these recommendations solved my problem. I don't know if it is an IE or issue windows. Any other suggestions?

    Hello

    Please 1 create a restore point and run the mcafee Development tool. This will of cleaning after uninstalling the software. McAfee is known for questions after the uninstalled. For new AV you can try

    Microsoft Security Essentials http://windows.microsoft.com/en-us/windows/security-essentials-download. (Win08 already has Microsoft Security Essentials in the operating system)

    Tool Development

    http://service.McAfee.com/FAQDocument.aspx?ID=TS101331

    Thank you

    Thomas

  • I get an error, "cannot view XML input using XSL sheet" when I try to install a mass storage driver.

    Original title: cannot view XML input using XSL sheet

    I can't install a mass storage driver. Message "Cannot view XML input using XSL sheet".
    Unspecified error.

    Hello

    I would have you post your query in the MSDN Forums, because it is addressed to an audience of it professionals.

    Your question would be more out there.

    Check out the link-

    http://social.msdn.Microsoft.com/forums/en-us/categories/

    Back to us for any issues related to Windows in the future. We will be happy to help you.

    Thank you.

  • Cannot view XML input using XSL style sheet. Fix the error and then click the Refresh button, or try again later.

    This is the message I got when my backup stopped and said cannot complete backup. Need answers?
    Cannot view XML input using XSL style sheet. Fix the error and then click the Refresh button, or try again later.

    --------------------------------------------------------------------------------

    A name was started with an invalid character. Error during processing of the resources ' file:///E:/WindowsImageBackup/ray-PC/Backup 2011-0...

    Hi lrl1of5,

    (1) do you use Windows Backup and Restore?

    (2) if it works well before?

    (3) remember to make changes?

    It is sufficient to indicate the complete error message you receive.

    Method 1: Run the fixit available in the links below and check if that makes a difference-Worth to try
    Difficulty of broken desktop shortcuts and common system maintenance tasks

    Note: FixIt would attempt to recover bad sectors on the hard disk, in the course of this process there are chances of DATA loss from that particular area.

    Method 2:  Clean boot the computer, then try to backup again

    Follow step 1 in the link below,
    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    Important: n ' forget not to put the computer to a normal startup follow step 7 in the link.

  • PHP, xml and Flash [multiple holders]

    Hello

    A few days ago, I posted a discussion related to php, xml and Flash. I want to display my xml in flash. I am using to do so. I now have a problem of obtaining xml data in my table to appear on different licensed video clips.

    It's my code. I tried a different configuration of the code, but without success.

    var urls:Array = [];

    var: index number;
    var index1:Number;

    var xml = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = parseXML;
    XML. Load ("Content.php");

    parseXML() {} function
    for (var i: Number = 0; i < this.firstChild.childNodes.length; i ++) {}
    URLs.push (this.firstChild.childNodes [i].firstChild.nodeValue);
    }

    index = 0;
    index1 = 1;

    startyourappF();

    }

    function startyourappF() {}

    this.onEnterFrame = preloadA;

    holder.loadMovie (urls [index]);

    This is me trying it to get the second element in the url in an another film clip holder.

    holder1.loadMovie (URLs [index1]);
    }

    function preloadA() {}

    If (Holder.getBytesLoaded () > 50 & & holder.getBytesLoaded () > = holder.getByte sTotal()) {}

    delete this.onEnterFrame;

    Holder._width = 260,0;

    Holder._height = 96.0;
    }

    This should be resizing to the holder of the second.
    If (holder1.getBytesLoaded () > 50 & & holder1.getBytesLoaded () > = holder1.getB ytesTotal()) {}

    delete this.onEnterFrame;

    holder1._width = 260,0;

    holder1._height = 96.0;
    }
    }

    The success of code loads the holder first image but cannot load the second url holder1 and others, that I want to add. I spend the whole night to try different configurations of the code but without success.

    I hope you can help me. All I need is more than an image loaded from the URL variable in several other variables of the licensee.

    Hope you can help.

    soon > >

    You must first set the structure of your directory and you will need to use relative URLS.  There is no sense to work on something else because what works now in your first image, and if you fix the code in your 2nd frame, it will break as soon as you download on your server.

    Thus, to duplicate the configuration of directory, that you plan to use on your server and use relative URLS.

    If your xml, html and swf are in the same directories and you intend to keep them in the same directories when you download on your server, use load ("timol.xml") to load your xml file.  Similarly, remove all path information to load anything else.

  • Passing object XML in Flash to ASP.

    Hi guys...

    Is it possible to pass a Variable of object/array of Flash XML to ASP?

    If it is, how to obtain and analyze the object/table XML variable in the ASP file?

    I intend to go with ASP to create an external XML file, and then I'll feed XML to Falsh data.
    Incase of additions or Corrections in the data, once again I'll pass the details of flash to ASP and replace the existing XML file.

    Please help me...

    Thanks in advance...

    - ****



    Thanks in advance...

    - ****

    The XML in Flash class has multiple ways to send data to pages of script on the server side. . Send(),. sendAndLoad(), etc..

    If you want the data sent in the form of XML object and not as a pair key/value as a form post, check if you set the contentType to "text/XML" before using the send() or sendAndLoad() controls.

    Read the XML code directly in ASP will require you to use the Request object.

    Set xml_dom = Server.CreateObject ("MSXML2. DOMDocument')
    xml_dom. Load (request)

    Tim

  • PHP, xml and Flash

    Hello

    Someone can help me. I try to query an sql database and echo the image in xml format so I can display the image in flash.

    I already know how to query and echo the url of the image of the database.

    This is the code:

    The database is queried at this stage already.

    echo "<? XML version=\"1.01\"? " "> \n";

    echo "< content > \n";

    While ($Nile = mysql_fetch_assoc (Run))

    {

    echo "< point >." $nile ['content']. "" < / item > \n ";

    }

    echo "< / content > \n";

    Flash I creat table to insert a URL and an xml object echoes images. It looks like this.

    This is after you have created the table of object and xml next url the loop for to insert the XML.

    thexml.onLoad = function)

    {

    var photos: Array = thisfirstChild.childNodes;

    for (i = 0; i < photos.length; i ++)

    {

    This pushes the XML in a table of URLs

    URLs.push (photos [i]. Attributes.URL);

    }

    This is supposed to load individual data into the flash movie object.

    movieobject.loadMovie(urls[0]);

    movieobject.loadMovie(urls[1]);

    }

    x.Load (Content.php);

    The echo in the first code xml produces a url link that contains a link to an image in the database. The flash is supposed to display the image on a flash clip call movieobject animation. I have some difficulty in getting the image displayed in flash. If anyone can change or provide the new code, it would be really useful.

    More PHP XML , you can view

  • Hierarchy Viewer - restarting the flash player

    Hello

    I created a hierarchy Viewer to see the connections between customers and when I run the application, the first time I see the hierarchy Viewer, I can see it correctly, as

    Parent

    Customer (wanted)

    Child

    Child

    but when I want to see another customer hierarchy I only see the Parent. I expand the tree to view the client sought and, if he has, the childs.

    Is anyway to, let say, restart Flash player so as it does initially, it presents the tree?

    Thank you

    I use jdev 11.1.1.7.1

    I managed to solve the problem, I had to add the same fragmentwhere that I wanted to see the information twice in the stream header and I select the option to display a profile each time I present to you with same departure (header and details) flow. This way the user as always for the menu who wants to see and the hierarchy Viewer, what it still load with the settings I selected.

    Thank you

  • All dynamic views for (Exadata) Flash using the Cache?

    All,

    Although it is one of the main points of sale of Exadata (especially of the X 3 from), I am struggling to find much information about our use of the Exadata Smart FlashCache (I'm under RDBMS 11.2.0.2 BP7 on a quarter V2-rack).

    I can check the FlashCache usage by checking if the object has been "pinned" to the FlashCache via DBA_SEGMENTS and I use FlashCache can check by querying a gv$ sysstat (and even v$ mystat), but are there other views that I could use? It seems a little strange for Oracle is not to enlighten the DBA on their use of this feature...

    Mark

    Hi Mark,

    My colleague Christo Kutrovsky put in place a script smart to collect this info of storage servers and accessed as an external table: http://www.pythian.com/blog/whats-in-your-exadata-smart-flash-cache/

    HTH!

    Marc

  • How do I get the number from a file xml for flash as3 area text 'Get_Days '?

    Hello

    I ended up at the daily update of the number of days since the specified days. Say, a work to be finished within 30 days. And the starting day is today. So, tomorrow it will be 29 days left. and so on...

    Thus, instead of reducing a number every day for the last number of days using the flash, it will be easy to change in the xml file.

    How can I do?

    I have a simple 'dynamic text box"text box and the name of the instance:"Days_Left. " Since I am a student, I can't do complex projects. I learn things that are small with very few lines of code that can be modified using xml files.

    So everything I type in a file xml, it must appear in a text box called "Days_Left".

    Thank you.

    You can use:

    var currentDate:Date = new Date();

    It is today
    var projectDueDate:Date = new Date (2010,11,29);

    use the date to the expiration date.

    months are zero-based.  (IE, jan for the month 0, dec is month 11)

    var daysToCompleteProject:Number = (projectDueDate.getTime()-currentDate.getTime())/(1000*60*60*24);

    This is the number of days between currentDate and projectDueDate.  You'll want to probably round or use days: hours: minutes for your display

  • "unpretictable" behavior XML in Flash and AS3

    Hello!

    Once I have fill a listcomponent in Flash using the following script I 'almost' the predictable result but at the end of the list, there is an element xml appearing as "not defined". There is nothing wrong with xml as the same elements works very well when they are moved to the top of the xml document. The problem is always the end of the list.

    Anyone have any idea what is the problem? What is the problems caused by empty content in elements? Can I convert this interpretation on / off in som way?

    Thank you

    function onLoaded(info:Event):void {}
    xmlFile = new XML (info.target.data);
    Li = xmlFile.Person;
    n = Li.length ();
    for (var i: uint = 0; i < n; i ++) {}
    If (li. ()) @Knr == "000")) {}
    trace ("got a 000");
    trace (xml. No [i]. (LastName);
    lb.addItem ({data: "Lastnameet:" + li.}) LastName.Text ([i]), label: li. Surname.Text ([i]));
    }
    }
    }

    It's

    li[i]. LastName.Text (),

    NOT

    Li. LastName.Text ([i] )

  • crossdomain. XML with Flash player 9.0.115.0

    Hi gurus,

    I just spent the better part of a day wading through the new features in Flash Player 9.0.115.0 security. I use the library of flash.socket, so I've discovered that I get this error message will get worse, that is to say, next version of Flash Player cannot connect even. Then, I got the good oil here.

    I wrote a crossdomain.xml file that looks like this (it's in the www-root directory):
    <? XML version = "1.0"? >
    < cross-domain-policy >
    < site permitted-cross-domain-policies of control = "master only" / >
    < allow-access-from domain = "192.168.5.201" to-ports = "7700" / >
    < / cross-domain-policy >

    Problem is that the reader flash adds the line follwing in the \Logs\policyFiles.txt it generates:
    WARNING: The 192.168.5.201 field does not specify a meta-policy. Meta-policy enforcement by default 'all '. This configuration is deprecated. See http://www.adobe.com/go/strict_policy_files to fix this problem.

    From my reading, I've specified a meta-policy with the line:
    < site permitted-cross-domain-policies of control = "master only" / >

    So my question is why it cannot find the meta-policy?

    Just thought that I should finish this.

    Today, I restarted my XP virtual machine and hey-presto that begins to operate. Further investigation led me to see that, for some reason, Firefox was not re-reading the crossdamain.xml file, but to instead stick with what he reads the first time, he is running (from a cold start).

    IE does not seem to suffer this caching, but at least I finally found why it did not work - it has not been read the changes that I made in the crossdomain.xml file.

    Kcell thanks for your time.

  • Cannot view full screen flash and silverlight media after Windows Update

    problems with flash and silverlight Muslim poor after windows update said updated the driver and will not play in full screen right.

    Windows Update told to update the driver of the GUI.  After I did my computer do not play in full screen with flash and silverlight. It makes a square with 3 inches on each side.  previously, it would fill the entire screen.  I already talked to Nivdia and they helped me to install again and it runs right is not their product.  I don't know if it's the Avermedia driver then that is the problem.  I have windows vista 32 bit.  When I try to click with the right button on the silvery light, it causes the failed computer.  I uninstalled flash light and silver and it does not solve the problem.

    Windows Update told to update the driver of the GUI.  After I did my computer do not play in full screen with flash and silverlight. It makes a square with 3 inches on each side.  previously, it would fill the entire screen.  I already talked to Nivdia and they helped me to install again and it runs right is not their product.  I don't know if it's the Avermedia driver then that is the problem.  I have windows vista 32 bit.  When I try to click with the right button on the silvery light, it causes the failed computer.  I uninstalled flash light and silver and it does not solve the problem.

    ===================================
    It might be worth a try to do a system restore to
    an hour before installing the updated video driver.

    With the help of the Windows Vista system restore
    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-system-restore/

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • XML and Flash CS4 - loading images

    Hello

    I am trying to learn how to use XML to load images and found a tutorial somewhere... Ok. HOWEVER, now I'm stuck on something.

    I have loaded a lot of inches and you want to load a larger image version when you click on its thumbnail.

    Had to work with, but poorly. Loading the same large image no matter what thumb is clicked. I would appreciate all the advice REALLY.

    Thank you!

    ============================================================================

    var xmlRequest:URLRequest = new URLRequest ("rockandroll.xml");
    var xmlLoader:URLLoader = new URLLoader (xmlRequest);
    var imgData:XML;
    var numberOfChildren:int;
    var hite:int;
    var wid:int;

    xmlLoader.load (xmlRequest);
    xmlLoader.addEventListener (Event.COMPLETE, xmlLoadedF);

    var imageLoader1:Loader = new Loader();
    var bigLoader:Loader = new Loader();

    var rawImage:String;
    var rawImage2:String;
    var imgNum:int = 0;

    function xmlLoadedF(event:Event):void {}
    imgData = new XML (event.target.data);
    numberOfChildren = imgData.*.length)
    var startX:int = 190;
    var startY: int = 60;
    var imgNum:int = 0;
    var ctr:int = 0;
    var cumuX:int = 0;

    while(imgNum<36) {}
    for (var cols: int = 0; < 7 passes passes ++) {}
    var b:MovieClip = new boxx();
    addChild (b);

    b.x = startX + collars * b.Width;
    //
    cumuX += Number (imgData.pic [imgNum] .imgW);
    //
    b.y = startY;
    rawImage = imgData.pic [imgNum] .thumb;
    rawImage2 = imgData.pic [imgNum] .big;
    var imageLoader1:Loader = new Loader();
    var bigLoader:Loader = new Loader();

    imageLoader1.load (new URLRequest (rawImage));

    imageLoader1.addEventListener (MouseEvent.CLICK, itsClicked);
    bigLoader.addEventListener (MouseEvent.CLICK, atmanebentayeb);
    b.addChild (imageLoader1);

    imageLoader1.x=(b.width-imgData.pic[imgNum].imgW)/2;
    imageLoader1.y=(b.height-imgData.pic[imgNum].imgH)/2;
    imgNum ++;
    }
    startY += b.height;
    b.x = startX;
    }

    function itsClicked(event:Event):void {}

    rawImage2 = imgData.pic [imgNum] .big;
    addChild (bigLoader);
    bigLoader.load (new URLRequest (rawImage2));
    bigLoader.addEventListener (MouseEvent.CLICK, atmanebentayeb);
    }
    function itsGone(event:Event):void {}
    removeChild (bigLoader);
    }
    }

    ===================================

    And here is a record in the XML file:

    <? XML version = "1.0" encoding = "utf-8"? >
    < photos >
    < pic >
    thumbs/1t.jpg < go > < / inch >
    images/1.jpg < big > < / big >
    < > 57 imgW < / imgW >
    < > 31 imgH < / imgH >
    < BIGimgW > 922 < / BIGimgW >
    < BIGimgH > 500 < / BIGimgH >
    < / pic >

    ... etc.

    =====================================

    Thanks again!

    use something like:

    var xmlRequest:URLRequest = new URLRequest ("rockandroll.xml");
    var xmlLoader:URLLoader = new URLLoader (xmlRequest);
    var imgData:XML;
    var numberOfChildren:int;
    var hite:int;
    var wid:int;

    xmlLoader.load (xmlRequest);
    xmlLoader.addEventListener (Event.COMPLETE, xmlLoadedF);

    var imageLoader1:Loader = new Loader();
    var bigLoader:Loader = new Loader();

    var rawImage:String;
    var rawImage2:String;
    var imgNum:int = 0;

    function xmlLoadedF(event:Event):void {}
    imgData = new XML (event.target.data);
    numberOfChildren = imgData.*.length)
    var startX:int = 190;
    var startY: int = 60;
    var imgNum:int = 0;
    var ctr:int = 0;
    var cumuX:int = 0;

    While (imgNum<>
    for (var cols: int = 0; cols)<7;>
    var b:MovieClip = new boxx();
    addChild (b);

    b.x = startX + collars * b.Width;
    //
    cumuX += Number (imgData.pic [imgNum] .imgW);
    //
    b.y = startY;
    rawImage = imgData.pic [imgNum] .thumb;
    rawImage2 = imgData.pic [imgNum] .big;


    var imageLoader1:Loader = new Loader();

    b.Big = rawImage2;
    imageLoader1.load (new URLRequest (rawImage));

    b.addEventListener (MouseEvent.CLICK, itsClicked);
    b.addChild (imageLoader1);
          
    imageLoader1.x=(b.width-imgData.pic[imgNum].imgW)/2;
    imageLoader1.y=(b.height-imgData.pic[imgNum].imgH)/2;
    imgNum ++;
    }
    startY += b.height;
    b.x = startX;
    }

    function itsClicked(event:Event):void {}
           
    var bigLoader:Loader = new Loader();
    addChild (bigLoader);
    bigLoader.load (new URLRequest (MovieClip (event.currentTarget) .big));
    bigLoader.addEventListener (MouseEvent.CLICK, atmanebentayeb);
    }
    function itsGone(event:Event):void {}
    removeChild (event.currentTarget);

    Loader (Event.currentTarget). RemoveEventListener (MouseEvent.Click, itsGone);

    event.currentTarget = null;

    }
    }

  • Bring XML in flash using a variable

    Hello world.

    I have a movieclip (jobImage) which I load an image (Image1, a subnode of Job1) using XML. But I want to be able to click on one of a series of buttons that will have this image replaced by a new image (eg. Button2 charge Image2, another under-node in Job1, Button3 load Image3, etc.).

    I have therefore the selected button transmit a return number to a variable called '_root.imageTarget '. If Button2 was down, this would happen:

    _root.imageTarget = '2 ';

    This variable is then combined with the word 'Image' to form a new variable (Martine)

    Martine = 'Image' + _root.imageTarget;

    And this variable is used to load the correct node

    jobImage.loadMovie ("Images /" + work_arr [Job1] .newImage);

    Except that it does not work. No idea why? When I write the actual name of the node, the script we successful:

    jobImage.loadMovie ("Images /" + work_arr [Task1].) Image2);

    Is it not possible to use a variable to target the correct node?

    Thanks for your time!

    Brian

    try this:

    Martine = 'Image' + _root.imageTarget;

    jobImage.loadMovie ("Images /" + work_arr [Job1] [idea]);

Maybe you are looking for

  • Cannot start in recovery. The recovery is available.

    I need to disable SIP using offline recovery. However, whenever I boot into recovery, it starts in the online version. I know I shouldn't disable SIP but I want, temporarily. So, how did I lose my recovery? I had OS X and Windows 10. Then, I partitio

  • Found that secret hidden Firefox traveled screenshots

    I mainly use Firefox as my browser on my most recent iMac with the mountain lion. I had accidentally deleted some photos of the family of my office and used a program of recovery tool to rub my hard disk for recently deleted images. The program worke

  • Health

    When I go to add an emergency contact name I want to use looks like gray clear and does not let me use this name. There are a few names that appear light grey instead of dark gray and bring up information about that name. Anyone know what is happenin

  • L450 suspend problem

    Hello I just bought a L450 (without fingerprint reader) and directly updated for Windows 10. The problem appears after crossing into suspend mode. When I try to turn it back on, there is no response: the screen remains black and the status led goes o

  • BlackBerry Smartphones BlackBerry Messenger - Reconfiguration policy IT

    Hi, I have a Blackberry 9900, when I try to open the Documents To Go, it apears: "you n ' have permission to use thi aplication because the COMPUTER Politycs put in place your blackberry admin!... can someone help me with this?"