loading xml file from flash

.NET Edition of the F-IN-BOX
tonychan
Posts: 3
Joined: Thu Aug 17, 2006 3:53 am

loading xml file from flash

Postby tonychan » Tue Aug 22, 2006 1:20 pm

Hi Softanics Site Admin,

My swf file need to load a xml file using the following method:

AS2
------------------------------------------------------
var xmlFile:XML = new XML();
xmlFile.ignoreWhite = true;
xmlFile.onLoad = function(success:Boolean) {...}
xmlFile.load("abc.xml");
------------------------------------------------------

VB.NET
------------------------------------------------------
Private Function FlashPlayerControl1_OnLoadExternalResource(ByVal strRelativePath As String) As System.IO.Stream Handles FlashPlayerControl1.OnLoadExternalResource

If strRelativePath = "abc.xml" Then
Return xmlStream
End If

Return Nothing

End Function
-------------------------------------------------------


This method does not work. It's the AS problem or the VB.NET problem? Do you have any solution to load the xml file to flash?

Thx a lot!

Tony Chan

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Tue Aug 22, 2006 4:32 pm

Thank you for your question.

Do you load the swf from a stream?
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

tonychan
Posts: 3
Joined: Thu Aug 17, 2006 3:53 am

Postby tonychan » Wed Aug 23, 2006 2:12 am

Yes. Both the swf and xml files are also loaded from stream.

In the sample files, I found that the "FlashPlayerControl1_OnLoadExternalResource" function in VB.NET is worked well with the "loadmovie()" function in AS2. However, is the "FlashPlayerControl1_OnLoadExternalResource" function in VB.NET worked with the "XML.load()" and "MovieClipLoader.loadClip()" functions in AS2 ?

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Wed Aug 23, 2006 6:40 am

Yes, it works. See this example:
http://f-in-box.com/TEMP/LoadXMLFromStream.zip

It demonstrates how to provide xml content from a stream.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html


Return to “.NET Edition”

Who is online

Users browsing this forum: No registered users and 10 guests

cron