Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-28-2004, 09:35 PM
Junior Member
 
Join Date: Oct 2004
Posts: 1
Default SWFGen using vb.net

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
Reply With Quote
  #2 (permalink)  
Old 11-09-2004, 03:04 PM
Junior Member
 
Join Date: Nov 2004
Posts: 4
Default Re:SWFGen using vb.net

I'd like to know myself. I've been pulling my hair out trying to transcribe this C#. This is a daunting task for me considering I have only fundamental understanding of C syntax.
Reply With Quote
  #3 (permalink)  
Old 11-09-2004, 05:17 PM
Junior Member
 
Join Date: Nov 2004
Posts: 4
Default Re:SWFGen using vb.net

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
Reply With Quote
  #4 (permalink)  
Old 11-09-2004, 05:46 PM
Junior Member
 
Join Date: Nov 2004
Posts: 4
Default Re:SWFGen using vb.net

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
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:29 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.