View Full Version : Help! VB6 w/ Flash
hyperkeios 6th May '08 Tue, 19:20 Mga sir and mam,
Ganito po kasi yun. Gumawa kami ng project sa vb 6.0. Ngayon, balak sana naming gumawa ng flash na button. Ayon nga po, nakagawa kami ng button sa flash. Inimport naman po namin ngayon sa form ng vb yung flash object. Tapos, nung lalagyan na sana namin ng program yung mismong flash object, nagulat kami kasi walang click event dun sa object. Pano po kaya namin lalagyan ng program yun. Kailangan kasi namin yung kasi sobrang metikoloso at metikolosa yung mga instuctor sa school namin na pati yung design at interface di pinapatawad sa pag-critics... :help: :upset:
thanks nang marami sa makakatulong sa amin. Any help will be greatly appreciated. Muwah! :excited:
freakice27 6th May '08 Tue, 19:30 dba para makapaglagay ng flash sa VB kailangan mo ung flash OCX?
choyaks 7th May '08 Wed, 05:26 Hey bro. medu may alam ako bout dyan.
Nga pla anong purpose ng flash button mo? I mean pag clik mo dun mismo sa program anong mangyayari?
kc my command button nman sa environment ng vb kaya prang no need na xa..
sa nagawa kng project kc ang purpose lng is pra ma control ung flash na file gamit ang command button or timer,example play anong frame sa flash. pro pag ung flash button mismo ung lalagyan ng code dun sa vb I think sa flash mo na ilagay ung code sa button.
Sana nakatulong.. :salute:
hyperkeios 7th May '08 Wed, 07:39 uu nga po may command button na sa visual basic. kaso nga, ampangit kasing tingnan kung yun yung gagamitin namin eh gumawa pa mandin kami ng vista style na interface. ginawa talaga naming glossy yung interface pati na yung button na ginawa namin sa flash.
dun naman po sa tanong ko, what i mean is that pano kaya namin lalagyan ng code yung button na ginawa namin eh wala namang "click" event kapat double click ko yung object ng flash. pano kaya ito. tska, dun sa sinasabi mong sa flash na ilagay yung code sa vb, pano yun? parang mahirap yata yun ah. :noidea:
hmx_ryan 7th May '08 Wed, 07:46 uu nga po may command button na sa visual basic. kaso nga, ampangit kasing tingnan kung yun yung gagamitin namin eh gumawa pa mandin kami ng vista style na interface. ginawa talaga naming glossy yung interface pati na yung button na ginawa namin sa flash.
dun naman po sa tanong ko, what i mean is that pano kaya namin lalagyan ng code yung button na ginawa namin eh wala namang "click" event kapat double click ko yung object ng flash. pano kaya ito. tska, dun sa sinasabi mong sa flash na ilagay yung code sa vb, pano yun? parang mahirap yata yun ah. :noidea:
Pwede yan... Gawa ka lang ng User Control mo... Tapos declare mo yung mga gusto mong EVENTS para dyan sa Flash Button mo...
Pero kung gusto mo talaga ng magandang GUI, gamtin mo na lang ang VS .Net 2008... Mas ok compare sa VB6.0.. Kaya nga lang, dapat may Net Framework ang na gusto mong installan..:D
choyaks 8th May '08 Thu, 06:16 Pwede yan... Gawa ka lang ng User Control mo... Tapos declare mo yung mga gusto mong EVENTS para dyan sa Flash Button mo...
Un pwd daw! pro dko pa kc na try kya hnd me mkaka2lng dyan.
c sir hmx_ryan mgaling yan sa programming! pa request lng tau ng example for learning purpose..hehe. pwd po ba sir? :pray:
hmx_ryan 8th May '08 Thu, 08:23 Un pwd daw! pro dko pa kc na try kya hnd me mkaka2lng dyan.
c sir hmx_ryan mgaling yan sa programming! pa request lng tau ng example for learning purpose..hehe. pwd po ba sir? :pray:
Example? :think: Sige na nga... I Assume na may background kayo sa FlashMX or Any Flash Animation Tool at VB6 ha... heres is it..
Steps to Create Program
The following steps will guide you in creating the files you opened above:
1. Start Flash MX, and make a new movie with any dimensions you would like. I used the dimensions 200px by 150px.
2. Next, make a new Button Symbol, and name it anything you want:
http://img229.imageshack.us/img229/2281/sample01bh6.jpg
[ create a new button symbol ]
3. Make a rectangle in the first frame of the button, about 10 X 50 pixels, any color other than your background color. Align it to the center of the scene.
4. Make a Key Frame in the next 2 frames of the button, and change the colors of the button for each frame:
http://img293.imageshack.us/img293/8426/sample02nd1.jpg
[ modify the button for the up, over, and down states]
5. Make a new layer, and put the word “Click” in that layer.
6. Now, go back to the Scene 1, and drag an instance of the Button onto the scene.
7. Drag a Text Field from the toolbox onto the scene, and give it the Dynamic Text property:
http://img292.imageshack.us/img292/7623/flashv2xg2.gif
[ the text field and button ]
8. Set the Instance Name to: “testField” and the var to: “testVar”.
http://img517.imageshack.us/img517/259/proptimsii2.jpg
[ the properties text field ]
9. Click on the Button on the Scene, and open the “Actions” box.
10. Type:
on (press) {
fscommand("setvalue", "Message A");
}
11. Publish the movie as a SWF File, save it as vbSample.swf, and exit Flash MX.
Now, in Visual Basic
Now, gagamitin natin yung ginawa natin animation sa Visual Basic:
1. Run Visual Basic, and start a new Standard EXE project.
2. Go to “Project | Components”, then look for the component called: “Shockwave Flash” this comes with every Flash Movie Player install, so if you can view Flash movies, you should be fine:
http://img440.imageshack.us/img440/9922/flashv3qr5.gif
[ the shockwave flash component ]
3. Drag an instance of the Shockwave Flash component into your main form. Add a Text Box, and a button.
4. Go to the Code Editor, and enter the following code:
Private Sub Command1_Click()
Call ShockwaveFlash1.SetVariable("testVar", "Message B")
'This sets the _ value of the variable in the Flash Project.
End Sub
Private Sub Form_Load()
Call ShockwaveFlash1.LoadMovie(0, CurDir + "/vbSample.swf")
‘This loads the movie that was made into level 0 of the project.
End Sub
Private Sub ShockwaveFlash1_FSCommand(ByVal command As String, ByVal args _As String)
Text1.Text = args
'this catches the action sent by Flash, and uses it in the TextBox.
End Sub
That’s it! Make the EXE file, and save it in the same folder as the flash movie, then run the exe!
dh23 8th May '08 Thu, 14:14 button lng ba un ggawin mo para may animation??
kun ganon lng purpose mo madali lng yan wala ka na iccode sa flash lalagyan mo lng xa ng label para ma call mo xa sa VB6
gamit ka ng FScommand para macall un madali lng yan pre kun animation na button lng meron ako copy kaso nasa bahay hehe sa opis kc ako ngaun, medyo nangalwang na kc ako pero naalala ko pa din yan pag nireview ko try ko pag uwi sa bahay ok
hyperkeios 8th May '08 Thu, 20:08 Example? :think: Sige na nga... I Assume na may background kayo sa FlashMX or Any Flash Animation Tool at VB6 ha... heres is it..
Steps to Create Program
The following steps will guide you in creating the files you opened above:
1. Start Flash MX, and make a new movie with any dimensions you would like. I used the dimensions 200px by 150px.
2. Next, make a new Button Symbol, and name it anything you want:
http://img229.imageshack.us/img229/2281/sample01bh6.jpg
[ create a new button symbol ]
3. Make a rectangle in the first frame of the button, about 10 X 50 pixels, any color other than your background color. Align it to the center of the scene.
4. Make a Key Frame in the next 2 frames of the button, and change the colors of the button for each frame:
http://img293.imageshack.us/img293/8426/sample02nd1.jpg
[ modify the button for the up, over, and down states]
5. Make a new layer, and put the word “Click” in that layer.
6. Now, go back to the Scene 1, and drag an instance of the Button onto the scene.
7. Drag a Text Field from the toolbox onto the scene, and give it the Dynamic Text property:
http://img292.imageshack.us/img292/7623/flashv2xg2.gif
[ the text field and button ]
8. Set the Instance Name to: “testField” and the var to: “testVar”.
http://img517.imageshack.us/img517/259/proptimsii2.jpg
[ the properties text field ]
9. Click on the Button on the Scene, and open the “Actions” box.
10. Type:
on (press) {
fscommand("setvalue", "Message A");
}
11. Publish the movie as a SWF File, save it as vbSample.swf, and exit Flash MX.
Now, in Visual Basic
Now, gagamitin natin yung ginawa natin animation sa Visual Basic:
1. Run Visual Basic, and start a new Standard EXE project.
2. Go to “Project | Components”, then look for the component called: “Shockwave Flash” this comes with every Flash Movie Player install, so if you can view Flash movies, you should be fine:
http://img440.imageshack.us/img440/9922/flashv3qr5.gif
[ the shockwave flash component ]
3. Drag an instance of the Shockwave Flash component into your main form. Add a Text Box, and a button.
4. Go to the Code Editor, and enter the following code:
Private Sub Command1_Click()
Call ShockwaveFlash1.SetVariable("testVar", "Message B")
'This sets the _ value of the variable in the Flash Project.
End Sub
Private Sub Form_Load()
Call ShockwaveFlash1.LoadMovie(0, CurDir + "/vbSample.swf")
‘This loads the movie that was made into level 0 of the project.
End Sub
Private Sub ShockwaveFlash1_FSCommand(ByVal command As String, ByVal args _As String)
Text1.Text = args
'this catches the action sent by Flash, and uses it in the TextBox.
End Sub
That’s it! Make the EXE file, and save it in the same folder as the flash movie, then run the exe!
antibay mo talaga sir hmx_ryan... :excited:
thanks sa tulong mo. ahaha.:praise::praise: :salute::salute:
choyaks 9th May '08 Fri, 06:09 thanks sir hmx_ryan! astig mo tlaga!!! very helpful po... :praise: :praise: :praise:
hmx_ryan 9th May '08 Fri, 08:08 No problem.. hehehhehe..:giggle:
Close nyo to hyperkeios..:D
|