Click here to Skip to main content
15,920,383 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello,

I am using swfdotnet to create swf file from C# code. I am looking for some code that will insert AS code to the first frame. I am creating the swf file using:
C#
Swf swf = new Swf();
swf.Size = new SwfDotNet.IO.Tags.Types.Rect(0, 0, 728 * 20, 90 * 20);
        swf.Tags.Add(new SetBackgroundColorTag(255, 255, 255));
        swf.Tags.Add(new ShowFrameTag());
        swf.Header.Fps = 30;
        
        SwfWriter writer = new SwfWriter(Server.MapPath("~\\Upload\\") + "/" + "newfile.swf");
        writer.Write(swf);
        writer.Close();

and I need to insert some Action Script code to the first keyframe of the first frame. I have the code hold in a string variable (so I dont need to write the code using swfdotnet) i only need to insert the code that in the string variable to the first keyframe. (the swf file is not complicated only 1 layer that include 1 keyframe (for as code) and thats all!!!
Posted
Updated 8-May-11 19:01pm
v2
Comments
ArtificerGM 8-Jun-11 17:54pm    
I hate answering questions with questions but...
As I understand it wouldn't you have to load and run the movie in order to manipulate it meaning that the time for first-frame code execution has already passed by the time you've inserted it?
Also, why must this action happen in the first frame, could you not just create an AS3 file with the code in it already and build the movie based on the AS3 class?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900