|
|||
|
I'm planning to use SWFGen in a .NET environment. However I only see examples of code in C#. I am working in vb. Does anyone have any examples? All I'm trying to do is substitute static text in an swf to something else.
I created a project...all compiled well and it runs fine. But the output file does not have the text substituted. thanks a bunch |
|
|||
|
AT LAST! Take a look at this...A friend of mine helped to rewrite the image.aspx.cs file and it seems to work like a charm. I replaced a couple of the PATH instances with static paths just for testing...hope this helps"
Imports System Imports System.Collections Imports System.ComponentModel Imports System.Data Imports System.Drawing Imports System.Web Imports System.Web.SessionState Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.HtmlControls Public Class image Inherits System.Web.UI.Page Private WithEvents m_xZGen As SWFGENLib.ZGenClass #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() End Sub 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here m_xZGen = New SWFGENLib.ZGenClass DoSub() End Sub Private Sub OnSubImage(ByVal obj As Object) Handles m_xZGen.OnSubImage Dim image As SWFGENLib.DataProxyImage = CType(obj, SWFGENLib.DataProxyImage) If (image.ID = 4) Then 'Dim path As String = FormalizePath(Server.MapPath("/SWFGen")) image.Image = "c:\\juliani.jpg" image.NeedSub = 1 End If End Sub Private Function FormalizePath(ByVal path As String) As String Dim length As Integer = path.Length If (path.Substring(length - 1) <> "\\") Then path += "\\" Return path End Function Private Sub DoSub() 'Dim path As String = FormalizePath(Server.MapPath("/SWFGen")) m_xZGen.load("C:\\source.swf") m_xZGen.save("C:\\widget.swf", 1) 'Dim output As Object = m_xZGen.save2(True) 'Response.BinaryWrite(CType(output, Byte())) End Sub End Class |
|
|||
|
OK, based on the above syntax I've re-written the subroutines for replacing text...hope this helps:
Private Sub OnBeforeSubText(ByVal obj As Object) Handles m_xZGen.OnBeforeSubText Dim text As SWFGENLib.IDataProxyString = CType(obj, SWFGENLib.IDataProxyString) text.NeedSub = 1 End Sub Private Sub OnSubText(ByVal obj As Object) Handles m_xZGen.OnSubText Dim text As SWFGENLib.DataProxyText = CType(obj, SWFGENLib.DataProxyText) text.FontName = "Verdana" If text.Text = "Static Text 0" Then text.Text = "SWF Generator ActiveX Object" text.Italic = 1 ElseIf text.Text = "Static Text 1" Then text.Text = "http://www.swfkit.com" text.Color = "0xFF0000" End If End Sub Private Sub OnSubEditText(ByVal obj As Object) Handles m_xZGen.OnSubEditText Dim text As SWFGENLib.DataProxyEditText = CType(obj, SWFGENLib.DataProxyEditText) Select Case text.Text Case "Question Text Here" text.Text = "Enter your question here" text.FontName = "Verdana" text.FontChars = " abcdefghjklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY Z" Case "Option #1" text.Text = "This is option number one." text.FontName = "Verdana" Case "Input Text 0" text.Text = "adalfsagfsgdshdh" Case "Input Text 1" text.Text = "szfsdgdhfdjhfgjkghkg" End Select End Sub |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|