Skip navigation


Now we know why using flash in 3dsMax we can now learn how to do it.

This second part will explain how to simply load a swf file in a Max Rollout  using an ActivX Control you can find a good help about ActivX in Maxscript Help in « Shockwave Flash ActiveX Object Events » part. 3ds max have a good help so « Use It!! ».

To host your Flash you need to generate a swf file from flash like this one:

A pic that show my Swf file.

This Pic show you my swf file it's a simple button with two statues "green" and "red" to toggle the Animate Mode in Max.

You doesn’t need to generate a .html to host you .fla a simple .swf is enough.

To host my file i need to create a rollout with the same size as my .swf using this code:

try(destroyDialog flashTest)catch()  –if opened
try(destroyDialog flashTest)catch()

rollout flashTest « Flash Test »
(

activeXControl flashhosteur « {D27CDB6E-AE6D-11cf-96B8-444553540000} » pos:[0,0] width:500 height:500 releaseOnClose:true

local SwfFile = « C:\\Users\\eddy\\Desktop\\flash3dsMax_explain\\vert.swf »

on flashTest open do
(

try
(
— initialise activeX object
flashhosteur.movie = SwfFile
)
catch
(
— retry
flashhosteur.movie = SwfFile
)

)
)
createDialog flashTest « Shockwave Flash Input Test » width:500 height:500

All parts explain:

try(destroyDialog flashTest)catch()  –if opened
try(destroyDialog flashTest)catch()

This part is used to close the rollout if his already opened before you open it again.

activeXControl flashhosteur « {D27CDB6E-AE6D-11cf-96B8-444553540000} » pos:[0,0] width:500 height:500 releaseOnClose:true

local SwfFile = « C:\\Users\\eddy\\Desktop\\flash3dsMax_explain\\vert.swf »

This part is used to create the activX hoster for our swf and create a variable that contain the .swf fil that will be hosted.

DO NOT FORGET to add double « \ » for path names.

If you use an IP adress use this format with:

local SwfFile = « \\\192.168.0.14\\ptites_poules\\flash3dsMax_explain\\vert.swf »

With an IP adress use 3 « \ ».

on flashTest open do

(

try
(
— initialise activeX object
flashhosteur.movie = SwfFile
enableAccelerators = false
)
catch
(
— retry
flashhosteur.movie = SwfFile
)
)

This part is used to initialize the .swf file the rollout when when  opening. We have to done it twice because sometimes it doesn’t work the first time but it always work the second time.

« enableAccelerators = false » it necessary for swf file where you will have keyboard entry if it’s true all the keyboard entry you will make will done inside 3dsMax interface and not the activX.

)
createDialog flashTest « Shockwave Flash Input Test » width:500 height:500

Finaly this part is used to create the final rollout with our swf file accessible.

Here is the final rollout with our .swf file hoster.

Publicités

One Comment

  1. Hello Eddy!

    I am student of 3D Animation in Canada and I found your blog very interesting.
    This way to work with flash UI’s in Max is really nice! I am very excited for the third part of this tutorial. When is this coming out??

    Regards,
    Valmor Garcia


Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s

%d blogueurs aiment cette page :