PDA

View Full Version : Using 2D vector graphics


Royans
10-11-2004, 08:58 AM
I was wondering whats the limitation in laszlo which stops me from drawing 2d vector graphics using actionscript. This is an example which I though should have worked, but it didn't.

I couldn't find even one example of allowing custom vector graphics on the laszlo documentation/faq/tutorials, but neither is there any mention that this is not supported explicitly.

This feature is a deal breaker for us to use it, so any ideas would help.

regards
rkt

<canvas width="500" height="150" bgcolor="green">
<script>
<![CDATA[

var paper:MovieClip = this.createEmptyMovieClip("paper",100);
paper.onMouseMove=function() {
paper.clear();
paper.lineStyle(3,0xFF0000,100);
paper.moveTo(100,200);
paper.curveTo(_xmouse,_ymouse,400,200);
updateAfterEvent();
};

]]>
</script>
</canvas>

nmadness
10-11-2004, 09:31 AM
The 2D drawing API is a SWF v6 feature - Laszlo currently only supports v5. Also, Laszlo doesn't use ActionScript, it uses JavaScript - minor syntax differences in language, big differences in API's - there is no createEmptyMovieClip() functions or MovieClip classes/objects.

Hopefully we'll see v6 support in the not too distant future, along with a drawing API of some sort.

Royans
10-11-2004, 09:58 AM
Darn.

Thanks for the reply.

Is there anyother way I can embed ActionScript
which can run at runtime ?

rkt

whisperstorm
10-29-2004, 01:10 PM
you can embed swf files directly into the laszlo application, so you could put all the actionscript etc. in that standalone swf and then include it as a resource I believe.