Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 526527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:47:11+00:00 2026-05-13T08:47:11+00:00

I want to load an SWF object from a Memory Stream or a byte

  • 0

I want to load an SWF object from a Memory Stream or a byte array instead of a file on disk.

AxShockwaveFlash class provides methods and properties to load an SWF providing its path to disk as a string but I haven’t seen another way of doing it. There is an InlineData property but generally the class is undocumented and I don’t know what this property does. Can it be done at all?

Thanks
F

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:47:11+00:00Added an answer on May 13, 2026 at 8:47 am

    I assume what you are wanting to do is initialize this in C# rather than in Flash itself. It can be done but there are limitations to doing it (for example you may get weird security issues). Another caveat is this has only been tested on VS 2010/Flash 10 but it should work in any version in theory.

    Okay, let us assume you have used the standard mechanism to put your flash control on the form. Also add the flash file you want to the resources (or an inline byte array, up to you).

    Then use the following code to load the flash file.

    private void InitFlashMovie(AxShockwaveFlash flashObj, byte[] swfFile)
    {
        using (MemoryStream stm = new MemoryStream())
        {
            using (BinaryWriter writer = new BinaryWriter(stm))
            {
                /* Write length of stream for AxHost.State */
                writer.Write(8 + swfFile.Length);
                /* Write Flash magic 'fUfU' */
                writer.Write(0x55665566);
                /* Length of swf file */
                writer.Write(swfFile.Length);                    
                writer.Write(swfFile);
                stm.Seek(0, SeekOrigin.Begin);
                /* 1 == IPeristStreamInit */
                flashObj.OcxState = new AxHost.State(stm, 1, false, null);
            }
        }
    }
    

    Pass the form’s flash object and the byte array containing the flash file to load and it should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to load PNG-file from resources. There is a roughly MFC-way (with CResourceStream
I want to load a palette from a bitmap file I have created. The
I have build one application in which I want to load SWF file build
I want to load SWF file dynamically in my webpage. But I don't know
We have a Flex web application. I want to load the swf file in
I'm using an AxShockwaveFlash object in C# to load and display a SWF inside
I want to load data from MySql database to a HTTP form When I
I want to load multiple variables into one .mat file at the end of
I want to load defined folders into my website from same system, now I
I want to load an swf into a flex 4 application in order to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.