+ Reply to Thread
Results 1 to 4 of 4

Thread: XML file loaded into flash

  1. #1
    Barn Enthusiast peebman2000 is on a distinguished road peebman2000's Avatar
    Join Date
    Mar 2008
    Posts
    215
    Rep Power
    4

    XML file loaded into flash

    Hey everyone its peebman2000, my boss has me doing programming as well as web designing. I think I need a raise. I'm working with flash and actionscript to load text and an image into a flash document, I"m using flash 8. Now I was sent to training for this, but I haven't used it since training; which was like a year ago.

    Anyway, i've looked through my training book and online, and I keep getting an error saying:
    Error opening URL "file:///C:\documents and Settings\peebma\desktop\sfcflash\sfc.xml"
    I have a folder that has the images and xml file, but I keep getting this error.

    Per what I've found online it might be something with my actionscript, i'm a huge newbie when it comes to actionscript. This is my first time using it for a project.

    Does anyone here know a little about actionscript and give any help on what i'm doing wrong?

    Let me know and thanks.

    XML file:

    <xml>
    <titles>
    <title>
    <text>Hello</text>
    <img>images/bbq.jpg</img>
    </title>
    </titles>
    </xml>
    Actionscript:
    Code:
    menuXml = new XML();
    menuXml.ignoreWhite = true;
    menuXml.onLoad = function(success) {
    	if(success){
    		
    			
    	item = _root.attachMovie("menutitle", "menutitle", 0);
    		item._x = 90;
    		item._y = 15;
    		item.titel_txt.text = this.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes;
    		
    	}
    }
    menuXml.load("C:\Documents and Settings\DPeebles\Desktop\osfcflash\osfc.xml");
    

  2. #2
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    I'm not a Flash/action script guy, but I see that your error specifies a different file than what you show in your code. Is it a typo or a problem?:

    sfcflash\sfc.xml

    osfcflash\osfc.xml

    I've also seen a few sites mention how Flash opens files locally. What location do you run this script from? Is it the same location as the xml file? If so, maybe try:

    Code:
    menuXml.load("osfc.xml");
    
    Unfortunately, I don't know much about Flash. Last time I touched it was back in 1997...and I didn't get very involved with it.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  3. #3
    Barn Enthusiast peebman2000 is on a distinguished road peebman2000's Avatar
    Join Date
    Mar 2008
    Posts
    215
    Rep Power
    4

    reply

    Thanks jmurrayhead, I don't know why he has me doing this.

    Anyway yes you are correct, I've changed it and saved the flash file in the same folder as the xml file. I know longer get the error, but the images are not showing up in the flash file.

    I'm looking up more stuff online on how to display images in flash from a xml file.

    If you know anything else, let me know and thanks for the reply.

    Quote Originally Posted by jmurrayhead View Post
    I'm not a Flash/action script guy, but I see that your error specifies a different file than what you show in your code. Is it a typo or a problem?:

    sfcflash\sfc.xml

    osfcflash\osfc.xml

    I've also seen a few sites mention how Flash opens files locally. What location do you run this script from? Is it the same location as the xml file? If so, maybe try:

    Code:
    menuXml.load("osfc.xml");
    
    Unfortunately, I don't know much about Flash. Last time I touched it was back in 1997...and I didn't get very involved with it.

  4. #4
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Quote Originally Posted by peebman2000 View Post
    Thanks jmurrayhead, I don't know why he has me doing this.

    Anyway yes you are correct, I've changed it and saved the flash file in the same folder as the xml file. I know longer get the error, but the images are not showing up in the flash file.

    I'm looking up more stuff online on how to display images in flash from a xml file.

    If you know anything else, let me know and thanks for the reply.
    As developers we are often expected to know how to do everything. Just one of the pains of the job lol. If I can think of anything else I'll let you know. Good luck
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


+ Reply to Thread

Bookmarks

Posting Permissions

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

SEO by vBSEO