query regarding f-in-box

.NET Edition of the F-IN-BOX
akshay
Posts: 1
Joined: Sat Oct 31, 2009 12:23 pm

query regarding f-in-box

Postby akshay » Sat Oct 31, 2009 12:31 pm

We are developing an flash application. Flash application has a wrapper swf in which all the other swf are loaded based on the button events. We are also loading sound.swf (for background music) which is loaded using "loadMovieNum" method,
where as other resources such as background images for swf are pulled using xml. We want encrypted flv and swf files to be used in application. Is it possible to show encrypted swf in other wrpaaer swf which is also an encrypted file?
And how to bind these swf files in control?

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

Postby Softanics » Sat Oct 31, 2009 8:26 pm

Thank you for your question.

Yes, it's possible.

At the first, you load your main swf from a stream using PutMovieFromStream:

Code: Select all

f_in_box__control1.PutMovieFromStream(stream);


To handle loading of child resources: xml, swf and so on, use the event OnLoadExternalResourceByRelativePath:

Code: Select all

private void OnLoadExternalResourceByRelativePath(object sender, String strRelativePath, System.IO.Stream Stream, ref bool Handled)   
{   
    System.IO.Stream FromStream = null;   
 
    if (strRelativePath == "images/embedded_image1.jpg")   
        FromStream = this.GetType().Assembly.GetManifestResourceStream
 
    if (FromStream != null)   
    {   
        const int size = 64 * 1024;   
        byte[] buffer = new byte[size];   
        int ReadBytes;   
 
        while ( (ReadBytes = FromStream.Read(buffer, 0, size)) > 0 )   
        {   
            try   
            {   
                Stream.Write(buffer, 0, size);   
            }   
            catch (System.IO.IOException /* e */ )   
            {   
                // Loading is interrupted   
                break;   
            }   
        }   
 
        Stream.Close();   
 
        Handled = true;   
    }   
}   


Thank you.
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