Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  Viewpoint ZoomView & Flash Authoring    ActionScript functions called by viewpoint buttons

Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
<cooladn>
Posted
Hi!
i try to use flash 5 swf as a texture on my viewpoint file.
I want to execute a personnal function that change a movieclip visibility propertie.
To do this, i write this actionscript on my swf:

function Action(x){
switch(x){
case "A":
if(_root.ModeT1On == true){
_root.ModeT1On = false;
} else{
_root.ModeT1On = true;
}
break;
case "B":
_root.ModeT1On = true;
break;
case "C":
_root.ModeT1On = true;
break;
case "D":
_root.ModeT1On = true;
break;
}
}

function Viewpoint(x){
if(x==1){
Action("A");
}else if(x == 2){
Action("B");
}else if(x == 3){
Action("C");
}else if(x == 4){
Action("D");
}
}

/** data tested by movieclip. movieclip._visible = 1 if _root.ModeT1On = true,
else movieclip._visible = 0. **/
_root.ModeT1On = true;

stop();


On my mtx file, i write this lines:
...
<MTSTimeElem Type="SWFView" Path="montre.swf" Name="interface">
<Target Name="MTSTexture.montre1" />
</MTSTimeElem>
....
<MTSInteractor Name="BtnA">
<Target Name="MTSInstance.Btn_A"/>
<OnEnter Action="MTSAssignProperty" Target="MTSScene::crsr" Value="MTSCursor::MTS_Point"/>
<OnExit Action="MTSAssignProperty" Target="MTSScene::crsr" Value="MTSCursor::0"/>
<OnClick Action="MTSSetProperty" Target="interface.SWF._root.Action("A")" Value=""/>
</MTSInteractor>

<MTSInteractor Name="BtnB">
<Target Name="MTSInstance.Btn_B"/>
<OnEnter Action="MTSAssignProperty" Target="MTSScene::crsr" Value="MTSCursor::MTS_Point"/>
<OnExit Action="MTSAssignProperty" Target="MTSScene::crsr" Value="MTSCursor::0"/>
<OnClick Action="MTSSetProperty" Target="interface.SWF._root.Action('B')" Value=""/>
</MTSInteractor>
.....

Could you help me?
Thinks a lot.
 
Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of duncan
Posted Hide Post
Well, from a glance your syntax looks correct except for the fact that you've got double quotes around the "A" instead of ticks. That would certainly break it... You might also try this:

<OnClick Action="MTSSetProperty" Target="interface.SWF._root.Action()" Value="A"/>

If you're still having problems though, zip up your assets and send to QA-Support@viewpoint.com attn: Daimen and I'll take a look.
 
Posts: 381 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
<cooladn>
Posted
thinks for your help.
I've solved the problem. Some actions as date difference seems to be not correctly supported.
So i've replace it by getTime() function.
Now it work.

The last problem concerns my flash prototype function.
Is it possible to play prototype function on flash. I use flash file as a texture.

this is my prototype function:

MovieClip.prototype.blink=function (periode) {
(this.prochainClignotement==null) ? this.prochainClignotement= getTimer() + periode : null;
if (getTimer()>=this.prochainClignotement) {
this._visible=not this._visible;
this.prochainClignotement=null;
}
}

I call it like this on my flash:
_root.mcReference.onEnterFrame=function(){this.blink(500);}

Then, I want to say a full flash 5 version with internal action work very well.

Thinks
 
Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of duncan
Posted Hide Post
prototypes are supported, though something else here might not be. I cannot tell from looking at your post though, you'll need to send me the source to look at.
 
Posts: 381 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  Viewpoint ZoomView & Flash Authoring    ActionScript functions called by viewpoint buttons