Home > ActionScript3, Flash, Flex > Flash Math Expression (Formula) Display

Flash Math Expression (Formula) Display

2月 24th, 2009

前回作った算数の式表示するやつをその辺にぺたぺた貼り付けられるようにしたものを作ったので使ってやってください。

コレ→ mathdisplay0_1.zip (9KBくらい)

<xml>A=<fract><n>x</n><d>y<sup>n</sup></d></fract></xml>

↑のxmlをflashvarsで渡すと↓のように表示されます。

This movie requires Flash Player 10

一応flashvars で、xml以外にfontsize, fontcolor, t_right , t_leftってのが送れまして、t_right, t_leftってのは、tracking right とleftのことです。
fontcolorは’ff00cc’みたいにしてRGBで送ってあげてください。
くわしくはzipの中にswfobject用のサンプルのhtmlが入ってるんでそれ見てください。
xml作成は前に作ったコレ使うと作りやすいかもしれません。

なんかWP-SWFObjectだとflashvarsが一個しか送れなくってこのブログでは色変更サンプル表示できませんorz
ともったらデキタ!

This movie requires Flash Player 10

※WP-SWFObjectのタグ書くときに&を使うと駄目みたいレス。&amp;と書いたらできますた。
var1=a&amp;var2=b みたいに書けばflashvarsいっぱい送れまっす。

WP-SWFObjectでの貼り付け方は↓みたいになります。

[SWF]url, 幅, 高さ, fontcolor=0066cc&amp;fontsize=30&amp;t_left=1&amp;t_right=1&amp;xml=<xml>XMLの内容</xml>[/SWF]

admin ActionScript3, Flash, Flex

  1. BlackHC
    6月 1st, 2009 at 07:20 | #1

    Hello,
    I’m currently investigating different options to embed formulas in Flash, and I find your example very interesting, but sadly I can’t read the rest :-)
    What language are you using for specifying the formulas? This looks more concise than MathML and quite similar to LaTeX.
    Thanks in advance.

  2. admin
    6月 2nd, 2009 at 15:23 | #2

    @BlackHC
    Hi thank you for the comment.
    This is a xml parser written with AS3 and text.engine lib ( available for flash10 ).
    Since I’m lazy, the current version only has fraction and exponentiation parser.
    ( So the variation of xml tags are very simple )
    You can find the usage example in the zip file above.

  1. No trackbacks yet.