<?php include("sample_utils.php"); // provides some utils and using mk $swfFN = "test_asset.swf"; // file to generate $shape1 = new MKshape_container(); // the shape $shape1->add_fillStyle_solid("#FF0000"); // add a new fill color $shape1->add_rect(-50, -50, 100, 100); // draw a rectangle $shape1->add_fillStyle_solid("#660000"); // add a new fill color $shape1->add_circle(30, 0, 0); // draw a circle $shapeTD1 = $shape1->update_tagData(); // get binary tag data $shapePB1 = $shape1->update_place_tagData(); $mc = new MKmovieclip("", 2); // create new movieclip $mc->set_linkage_name("mc"); // assign a linkage name $mc->add_tagData($shapePB1, 1); // populate mc with placing settings $mcTD = $mc->update_tagData(); // get binary tag data from mc $mcAssetTD = $mc->update_linkage_tagData(); $swf = new MKswf($swfFN); // start a fresh swf $swf->set_swfDir(SERVER_MKTMP); // change default working dir $swf->set_swfVersion(7); // set version (flash mx 2004) $swf->set_fps(24); // set frames per second $swf->add_tagData($shapeTD1); // populate with shape $swf->add_tagData($mcTD); // populate with mc $swf->add_tagData($mcAssetTD); // populate with linkage $swf->swf_output(); // save to disk $swfHeader = $swf->fetch_assoc(); $str = "<div style=\"background-color:#CCCCCC; width:700px; height:500px; padding:10px; text-align:center\">"; $str .= render_swf_box($swfHeader, $imgDir, false); $str .= "<br/><strong>" .$swfFN ." created in :<br />"; $str .= SERVER_MKTMP ."</strong><p>don't worry if it looks empty :P</div>"; ?>
Linkage Symbols are used at run-time by actionscript, they are like actors awaiting in the backstage, ready to let the show go on at your call. The movie created by this sample in effect will looks empty an unusable as is.
The main objective of creating movies with linkage symbols is to constitute the initial stage developing a whole flash app. Mk support actionscript partially at bytecode level with an approach very similar to flasm, see sample #18, you may use advanced open source developing tools such are:
The are useful video tutorial to get start in developing in flash, mk "can" be used instead of flash IDE e.g. in the video #07