no action script in ported code from php to c++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello
im trying to port simple code from :http://www.gazbming.com/ the
Flash 8 perlin - click on the boxes example.
this is my code : and its not working im getting only swf background color with no Action script .
what im doing wrong here ? Thanks...
if ( Ming_init() )
        {
            fprintf(stderr, "Ming initialization error\n");
            exit(EXIT_FAILURE);
        }
         
        Ming_setScale(20.0000000);
        Ming_useSWFVersion(8);
        Ming_setSWFCompression(9);
       
        m->setRate(31);
        m->setDimension(550,400);
        /* initialize random seed: */
        srand (0xFF);
        /* generate secret number: */
        int iRend0 = rand() % 0xFF ;
        int iRend1 = rand() % 0xFF ;
        int iRend2 = rand() % 0xFF ;

        m->setBackground(iRend0,iRend1,iRend2);
        std::string actionScript =  "boxwidth=200;\n"
                                    "boxheight=200;\n"// create references to classes
                                    "fdb=flash.display.BitmapData;\n"
                                    "fgp=flash.geom.Point;\n"
                                    "points = [];\n"
                                    "points.push(new Point(50, 50));\n"
                                    "points.push(new Point(0, 0));\n"
                                    "points.push(new Point(30, 0));\n"
                                    "points.push(new Point(10, 70));\n"
                                    "points.push(new Point(20, 0));\n"
                                    "points.push(new Point(0, 20));\n"
                                    "var fdb1 = new fdb(boxwidth, boxheight, false, 0x00CCCCCC);\n"
                                    "var fdb2 = new fdb(boxwidth, boxheight, false, 0x00FF0000);\n"
                                    "var mc1 = this.createEmptyMovieClip(\"mc1\", this.getNextHighestDepth());\n"
                                    "mc1.attachBitmap(fdb1, this.getNextHighestDepth());\n"
                                    "mc1._x=Stage.width/2-boxwidth;\n"
                                    "mc1._y=Stage.height/2-boxheight/2;\n"
                                    "// color\n"
                                    "var mc2 = this.createEmptyMovieClip(\"mc2\", this.getNextHighestDepth());\n"
                                    "mc2.attachBitmap(fdb2, this.getNextHighestDepth());\n"
                                    "mc2._x = Stage.width/2;\n"
                                    "mc2._y=Stage.height/2-boxheight/2;\n"
                                    "// grey\n"
                                    "mc1. {\n"
                                        "var randomNum = Math.floor(Math.random() * 10);\n"
                                            "fdb1.perlinNoise(200, 200, 6, randomNum, false, true, 1, true, null);\n"
                                    "};"
                                    "// color\n"
                                    "mc2. {\n"
                                        "var randomNum = Math.floor(Math.random() * 10);\n"
                                            "fdb2.perlinNoise(200, 200, 4, randomNum, false, false, 15, false, points);\n"
                                       
                                    "};\n";

        std::ofstream file("ASoutput.txt", std::ios_base::binary);
        file << actionScript.c_str();
        file.close();
       
        m->add(new SWFAction(actionScript.c_str()));
        m->save("test242.swf");


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ming-users mailing list
Ming-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ming-users

[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux