Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  Viewpoint Tips, Tricks & Hacks    need help!!! script betweem the VMP and embeded flash

Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Member
Posted
Hi,

I can apply a .swf file as a texture to my 3d object.
How can I communicate with that flash file?

I found a old post on our forum:
http://viewpoint.infopop.cc/eve/forums/a/tpc/f/6432928096/m/4742995947

I really need the basic tutorial on
http://developer.viewpoint.com/developerzone/examples/ft-120502/index.html

Unfortunately, I can not find that pageFrown

Need help!!!

Thanks a lot
 
Posts: 181 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
I put a simple sample which include the problem.

I really need helpSmile

Thanks

ask.rar (19 KB, 5 downloads) problem file
 
Posts: 181 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of DavidR
Posted Hide Post
Hi cgkuake,
From the Master of Viewpoint Library we have a PDF called "Scripting Flash from outside" Hope this copy and paste helps you get started!
DavidR
---------------------------------------

Scripting FLASH from outside
What can you do?
- Get/Set values assigned to Edit Text
- Get/Set movie clip properties (positions, rotation, scale, alpha…)
- Access all the Action Script objects (Date,Math,MovieClip,String …)
- Access all the variables defined in ActionScript
- Access all the methods and functions defined in Action Script
- Access to the whole flash tree (DOM)
How?
In order to do that, we use the property system.
All the properties will be flash content dependant, so, to differentiate flash TimeElem properties from flash internal properties, we added the keyword “SWF”
Example
<MTSSetProperty Target="myFlash.SWF.root.frank._rotation" Value="45" />
myFlash is the flash TimeElem
SWF is the special keyword to access internal flash elements
root.Frank.rotation : specified exactly like in action script.
Syntax
1)sensitive
In action script, access to variables, objects… is not case sensitive, it will be the same in SetProperty for elements specified after SWF.
<MTSSetProperty Target="myFlash.SWF.root.Frank._Rotation" Value="45" />
<MTSSetProperty Target="myFlash.SWF.Root.frank._rotation" Value="45" />
both are valid and the same.
However, the general recommendation is to work as if it were case-sensitive (use _rotation above – properties are not capitalized), because actionscript is based on ECMAscript, which IS case-sensitive. The current lack of case-sensitivity is for
backwards compatibility with Flash 4. Some elements introduced afterwards (like onClipEvent) rely on case, and future syntax elements may as well.
2)root
Like in ActionScript, the “_root” object is not compulsory - it indicates the object’s location in the movie.
"myFlash.SWF._root.frank._rotation" is equivalent to "myFlash.SWF.frank._rotation", and assumes frank is located at the root level of the movie. _root is used in Flash commonly because it is possible to play one Flash movie inside another. In the event you developed a movie with a number of variables, using _root as a location for variables would help to insure your movie would work even if played inside another swf.
3)objects
In ActionScript, to access objects, the syntax is :
Object.method(arg1,arg2,…);
From properties, it will be exactly the same, you can do :
(a) <MTSSetProperty Target="myFlash.SWF.root.gotoAndStop(2)" Value="" />
Also, another syntax can be used here to be able to animate the Value
(b) <MTSSetProperty Target="myFlash.SWF.root.gotoAndStop()" Value="2" />
Why both syntax available :
- with (a) you can access methods with multiple arguments “myFlash.SWF.math.Tan2(2.3,1.6)”
- with (b) you can animate with for example keyframes the values passed to the methods.
MovieClip
With DOM, all the movie clips in your flash file can be accessed from property system:
"myFlash.SWF.root.clip1.subClip2.subsubClip3”
Properties available :
yes "_x",
yes "_y",
yes "_xscale",
yes "_yscale",
no ePropertyCurrentFrame
no ePropertyTotalFrames
yes "_alpha",
yes "_visible",
yes "_width",
yes "_height",
yes "_rotation",
no ePropertyTarget
no ePropertyFramesLoaded
yes “_name” no ePropertyDropTarget
no ePropertyUrl
yes “_highQuality”
no ePropertyFocusRect
no ePropertySoundBufTime
Methods available :
"attachMovie()"
yes "duplicateMovieClip()"
yes "getBounds()"
yes "getBytesLoaded()"
yes "getBytesTotal()"
"getURL()"
yes "globalToLocal()"
yes "gotoAndPlay()"
yes "gotoAndStop()"
yes "hitTest()"
yes "loadMovie()"
"loadVariables()"
yes "localToGlobal()"
yes "nextFrame()"
yes "play()"
yes "prevFrame()"
yes "removeMovieclip()"
yes "startDrag()"
yes "stop()"
yes "stopDrag()"
yes "swapDepths()"
"unloadMovie()"
yes "goto"
Objects
Date
Methods available:
"getDate()"
"getDay()"
"getFullYear()"
"getHours()"
"getMilliseconds()"
"getMinutes()"
"getMonth()"
"getSeconds()"
"getTime()"
Math
Methods available:
"abs()",
"acos()",
"asin()",
"atan()",
"atan2()",
"ceil()",
"cos()",
"exp()",
"floor()",
"log()",
"pow()",
"random()",
"round()",
"sin()",
"sqrt()",
"tan()"
"max()",
"min()",
String
Methods available:
"fromCharCode()",
"charAt()",
"charCodeAt()",
"concat()",
"indexOf()",
"lastIndexOf()",
"slice()",
"split()",
"substr()",
"substring()",
"toLowerCase()",
"toUpperCase()",
"toString()",
"valueOf()"
Array
Methods available:
"concat()"
"join()"
"pop()"
"push()"
"reverse()"
"shift()"
"slice()"
"sort()"
"splice()"
"toString()"
"unshift()"
Edit Text
- All the variables declared in actionScript are available in the property system.
When an edit text is added to the scene, if a variable name is specified, by accessing this variable, it will be possible to set/get the value of an edit text.
Further Reference
For specific actionscript syntax questions, check Macromedia’s actionscript dictionary:
http://www.macromedia.com/support/flash/action_scripts/...onscript_dictionary/
Actionscript the Definitive Guide ( available from http://www.oreilly.com) is probably the most comprehensive print resource.
 
Posts: 308 | Location: Atlanta Georgia | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Hi DavidR,

Thanks for your info.
Can you help me checking my sample files?
 
Posts: 181 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Here is a sample which works perfectly provided by viewpoint.
The question is I can not find the part of code which control the communication.

Zip/GZ archiveflash_menu_texture.zip (18 KB, 13 downloads) sample
 
Posts: 181 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  Viewpoint Tips, Tricks & Hacks    need help!!! script betweem the VMP and embeded flash