A Flash Developer Resource Site

Page 3 of 4 FirstFirst 1234 LastLast
Results 41 to 60 of 68

Thread: World of Warcraft Armory xml feed...

  1. #41
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    wow im happy to see this thread breathing! When I started it I couldn't find anything usable via Google! (although I needed a pure flash solution)
    Evolve Designs Interactive Media
    the natural selection

  2. #42
    Senior Member
    Join Date
    Nov 2000
    Posts
    259
    OK I need some more specification here...
    From what I've seen, that code goes into dreamweaver and not flash, correct?
    What I need is just the flash-side code, and no need for guild stuff.
    The idea is just for making guildies signatures, and not having to update them every time we change gear...that's it.
    So I just need the code for flash to get the char's info, and display it. And I also need to know how to get certain details, because different classes will want different info displayed. Tanks will want def, armor, block etc. DPS will want melee/spell dmg, etc.
    Up the Irons!!

  3. #43
    Senior Member
    Join Date
    Nov 2000
    Posts
    259
    And yes, I would like it very much if you posted the fla you're using...
    Up the Irons!!

  4. #44
    Member
    Join Date
    May 2003
    Location
    Florida
    Posts
    90
    this is the code that is being run to fill the database once the roster has been populated.
    you can clean up the database queries and you will have the key's used to fill in each member table

    all you have to do is echo these out straight to flash instead of sending them to a database and have flash load it via loadvars.

    Code:
    <?php
    include("../dbconnect.php");
    
    connect();
    
    //empties current member list for new population
    echo "Member table is being cleaned.";
    $clean = "TRUNCATE TABLE  members";
    mysql_query($clean);
    
    $sql = "SELECT * FROM `roster`";
    $res = mysql_query($sql);
    
    
    
    
    
    function contents($parser, $data){}
    	
    function startTag($parser, $data, $param)
    {
    	global $i;
    	global $j;
    	global $prof;
    	global $profVal;
    	global $tree1;
    	global $tree2;
    	global $tree3;
    	
    		
    	if($param["KEY"] != NULL)
    	{
    		$prof[$i] = $param["KEY"];
    		$profVal[$i] = $param["VALUE"];
    		$i++;
    		
    	}
    	if($param["TREEONE"] != NULL)
    	{
    		$tree1 = $param["TREEONE"];
    		$tree2 = $param["TREETWO"];
    		$tree3 = $param["TREETHREE"];
    	}
    }
    	
    function endTag($parser, $data){}
    
    
    while($dataS = mysql_fetch_row($res))
    {
    
    	$i=0;
    $j=0;
    $prof = Array();
    $profVal = Array();
    $tree1 = 0;
    $tree2 = 0;
    $tree3 = 0;
    
    
    	$myvar = curl_init();
    	$name = $dataS[1];
    	$level = $dataS[2];
    	$race = $dataS[3];
    	$class = $dataS[4];
    	$rank = $dataS[5];
    	
    	$myURL = "http://www.wowarmory.com/character-sheet.xml?r=Lightninghoof&n=" . $name;
    	curl_setopt($myvar, CURLOPT_USERAGENT, '[Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2")]');
    	curl_setopt($myvar, CURLOPT_URL, $myURL);
    	curl_setopt($myvar, CURLOPT_RETURNTRANSFER, TRUE);
    	$xmlstr = curl_exec ($myvar);
    	
    	curl_close ($myvar);
    
    	$data = $xmlstr;
    		
    	$xml_parser = xml_parser_create();
    	
    	xml_set_element_handler($xml_parser, "startTag", "endTag");
    	
    	xml_set_character_data_handler($xml_parser, "contents");
    	
    	
    	if(!(xml_parse($xml_parser, $data))){
    		die("Error on line " . xml_get_current_line_number($xml_parser));
    		}
    	
    	xml_parser_free($xml_parser);
    	
    	$sql = "INSERT INTO `members` VALUES(NULL, '$name', '$level', '$race' , '$class', '$rank', '$tree1', '$tree2', '$tree3', '$prof[0]', '$prof[1]', '$profVal[0]', '$profVal[1]', 'none')";
    	if(!mysql_query($sql)) die("Error inserting values");
    			
    }
    
    echo "<br>";
    
    echo "Members details successfully populated.";
    
    	
    ?>
    visit my portfolio and sign my guestbook!!

  5. #45
    Senior Member
    Join Date
    Nov 2000
    Posts
    259
    Yay, now that's more like it...
    Thank you thank you thank you soooo much!!!!

    If I have any problems getting it to work, I'll be sure to post here.
    Thanks again!
    Up the Irons!!

  6. #46
    Member
    Join Date
    May 2003
    Location
    Florida
    Posts
    90
    no prob
    visit my portfolio and sign my guestbook!!

  7. #47
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    Glad you found a solution Baterax....

    however I dont think this is really 'on-topic' since it was:

    1.) an all FLASH solution origianlly

    2.) then the situation of the same FLASH/AS code not working in CS3.


    the PHP solution is fine.. but really wasnt part of the equation.. Not that it was welcomed of course. (to be clear)

    but.. to be CLEAR.. there should be NO NEED FOR PHP AT ALL.

    again.. PHP IS NOT NEEDED.

    the F8/AS2 solution posted doesnt need any PHP/server side scripting help.

    however the SAME CODE/.FLA opened and saved in CS3 still as an AS2 document, does NOT work from what I am told.

    I know CS3/AS3 has anew way of handling XML..but I thought it would be compatible still??

  8. #48
    Senior Member
    Join Date
    Nov 2000
    Posts
    259
    Actually, an all-flash solution would be better, because I don't know the first thing about PHP, and thus I'm having trouble using that solution.
    Up the Irons!!

  9. #49
    Senior Member
    Join Date
    Nov 2000
    Posts
    259
    Found this C++ code, if it helps...

    ---8<---

    // You will need this include to make use of the internet MFC classes

    #include <afxinet.h>



    // This is a browser version string that will trick the Arena into believing

    // we're a browser that supports XML/XSL.

    static const char s_szAgent[] = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2";



    CString strXml; // We'll be storing the XML data in here.



    try

    {

    // Make a session, appearing to be a "modern browser"

    CInternetSession objSession(s_szAgent);

    // Open the URL, transfer as ASCII, don't load from cache and don't store in cache.

    CHttpFile* pFile = (CHttpFile*)objSession.OpenURL(strURL, 1,INTERNET_FLAG_TRANSFER_ASCII | INTERNET_FLAG_RELOAD | INTERNET_FLAG_DONT_CACHE);



    // If open succeeded, read the file.

    if (pFile)

    {

    CString strLine;

    while (pFile->ReadString(strLine))

    {

    strXML+=strLine;

    strXML+="\n";

    }



    pFile->Close();

    delete pFile;

    }

    }

    catch (CInternetException* pEx)

    {

    pEx->ReportError();

    pEx->Delete();

    }


    ---8<---
    Up the Irons!!

  10. #50
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    Im sorry..

    I guess Im just NOT following anymore..


    1.) an ALL flash solution has been provided.. posted and working exmaples made.. you didnt want them I guess? F8 only I believe.


    2.) somehow PHP got thrown into the mix here.. no clue why

    3.) and now C++ is being used??

  11. #51
    Senior Member
    Join Date
    Nov 2000
    Posts
    259
    I need the flash only thing to work in CS3, so that didn't solve it...
    Up the Irons!!

  12. #52
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    well if you get tired of waiting you can always grab a demo of flash8 just to output your file, you'll have 30 days to figure out your app hehe
    Evolve Designs Interactive Media
    the natural selection

  13. #53
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    I think CS3 has a different native way of dealing with XML... so things may be different.. I dont have CS3 to play with (well not installed at least).. or maybe AS3 just has a new way of dealing with it..

  14. #54
    Member
    Join Date
    May 2003
    Location
    Florida
    Posts
    90
    im sorry if my post went off topic, was just trying to help.
    that being said, I used php because I did not want to ping the armory everytime someone refreshed the site or accessed the page, hence storing the data and doing biweekly updates or so.
    visit my portfolio and sign my guestbook!!

  15. #55
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    I stated your input was helpful & welcomed.. I just wanted to be clear on the GOAL/TOPIC as well as clarify that PHP or C++ nor any 3rd party tool is required... and how to get the same code to work with CS3.. even if exported for Flash Player 8 & AS2 (I believe those settings were tried)

  16. #56
    Senior Member
    Join Date
    Nov 2000
    Posts
    259
    OK I still can't make it work...anyone else???
    Up the Irons!!

  17. #57
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    OMG!>. what is wrong now? You have SEVERAL examples even posted for you...

    If your looking for help on PHP or C++ or whatever else your trying to use.. this probably IS NOT THE PLACE to get help for that.


    (Maybe the backend & scripting forum here)??

  18. #58
    Senior Member
    Join Date
    Nov 2000
    Posts
    259
    No, I need the only solution that isn't posted. CS3.
    Up the Irons!!

  19. #59
    Senior Member
    Join Date
    Nov 2000
    Posts
    259
    Because I've been trying desperately to get the flash 8 version to work in CS3, no luck even using flash 8 publish setting.
    Up the Irons!!

  20. #60
    Senior Member
    Join Date
    Nov 2000
    Posts
    259
    Bump!
    Up the Irons!!

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