A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: [RESOLVED] [CS3] xml read using anchor tag

  1. #1
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160

    resolved [RESOLVED] [CS3] xml read using anchor tag

    i am using this piece of code so that when i click on a text link having an url it will open in a window. The problem i encounter now is that when you give trace to read the content, it reads well but the same conent is not poperly getting displayed in the textbox.


    PHP Code:
    fff = new XML();
    blog_array_title = new Array();
    blog_array_content = new Array();
    fff.load("blog.xml");
    fff.ignoreWhite true;
    fff.onLoad = function(success) {
        if (
    success) {        
            
    hhh.htmlText fff.firstChild.firstChild.childNodes[0].nodeValue
            trace
    (fff.firstChild.firstChild.childNodes[0].nodeValue);
        }
    }; 
    my xml file:
    <blog>
    <page heading="Blood Groups"><![CDATA[A blood type (also called a blood group) is a classification of blood based on the presence or absence of inherited <u><A HREF=\"asfunction: opurl,http://en.wikipedia.org/wiki/Antigen \">antigenic</A></u> substances on the surface of red blood cells (RBCs). These antigens may be proteins, carbohydrates, glycoproteins, or glycolipids, depending on the blood group system, and some of these antigens are also present on the surface of other types of cells of various tissues.]]>
    </page>
    </blog>

  2. #2
    AS3 Mod
    Join Date
    Sep 2007
    Location
    O-H-I-O
    Posts
    2,385
    So to be sure, the trace works as it should and the textfield does not?

    Make sure you set hhh.html = true; - Also can you show us what prints in the textfield?

  3. #3
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    my texbox is already set to html=true... still doesn't work.
    my trace works just perfect.

    This is what i get in my textbox:
    A blood type (also called a blood group) is a classification of blood based on the presence or absence of inherited
    .... so, i can notice that everything that comes after <u><A HREF=\"asfunction has been ignored.

  4. #4
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    anyone??

  5. #5

  6. #6
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    great, so now the content is displayed in the dynamic box BUT when i click on the link, nothing happens. getURL function not working.
    This is my function:
    PHP Code:
    function opurl(get_lnk) {
        
    getURL(get_lnk"_blank");


  7. #7
    http://www.in3d.eu Kostas Zotos's Avatar
    Join Date
    Jul 2007
    Location
    Athens - Greece
    Posts
    408
    Hi,

    Problems are: the slashes (to esacpe quotes) and spaces inside "asfunction"
    Remove the spaces between "asfunction" and colon symbol (and if any between function name -opurl- and commas):

    Copy this xml:
    Code:
    <blog>
    <page heading="Blood Groups"><![CDATA[A blood type (also called a blood group) is a classification of blood based on the presence or absence of inherited  <u><a href="asfunction:opurl,http://en.wikipedia.org/wiki/Antigen">antigenic</a></u> substances on the surface of red blood cells (RBCs). These antigens may be proteins, carbohydrates, glycoproteins, or glycolipids, depending on the blood group system, and some of these antigens are also present on the surface of other types of cells of various tissues.]]>
    </page>
    </blog>

    Kostas
    K. Zotos online portfolio: http://www.in3d.eu

  8. #8
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    i copied your xml code and pasted in a new xml file. still i do not get any links opening up when i click on the text link antigenic. infact, the below function is not even getting triggered when i give a trace action. My dynamic textbox is working fine.

    PHP Code:
    function opurl(get_lnk) { 
        
    trace("url opened:"+get_lnk);
        
    getURL(get_lnk"_blank"); 


  9. #9
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    after a couple of tests now i find that it works fine ONLY in a new fla file
    ...but my actual fla file uses the same code except that it stores cdata content in array and then pushes it into dynamic textbox, anyhow both does the same job.

    Also my function opurl(get_lnk), is in the same frame where i have this xml parsing code. SO why this problem? Is it because i have the scripts inside Nth level movieClip?? I dont think this can cause a problem.

  10. #10
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    Finally............. got it working.... it was a function problem. The anchor tag was not able to recognise my function name may be because i had this function inside an MC..inside MC..inside MC.......12th level MC.. So i changed it to a global function and works perfect
    Thank you guys for helping me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center