Save runtime AS3 graphic to FLA Library

Posted on 2009-02-09
Last Modified: 2013-11-11

I have the following Actionscript 3 code which generates a particle grid. If I wanted to modify the code in Flash, run it and then have what is shown in the FLA (a grid of comma shapes) be saved within the FLA in a movieclip how would I do that?

import flash.display.MovieClip;


import flash.display.Bitmap;

import flash.display.BitmapData;

import flash.display.Sprite;

var pixelated_mc:MovieClip = new MovieClip();


pixelated_mc.y = 0;

pixelated_mc.x = 0;

var commaHolder_mc:MovieClip = new MovieClip();

commaHolder_mc.y = 0;

commaHolder_mc.x = 0;

//pixelated_mc.addEventListener(MouseEvent.MOUSE_OVER, onRoll);


var pixelSize = 6;

function pixelate(){

    var bitmapData:BitmapData = new BitmapData( original_mc.width/pixelSize, original_mc.height/pixelSize, false );

    var bitmap:Bitmap = new Bitmap(bitmapData);


    var scaleMatrix:Matrix = new Matrix();

    scaleMatrix.scale(1/pixelSize, 1/pixelSize);

    bitmapData.draw( original_mc, scaleMatrix );

bitmap.width = original_mc.width;

bitmap.height = original_mc.height;



function tileBG(pixelNum:Number):void { 

for(var i=0; i < original_mc.height/pixelSize; i++) {

  for(var j=0; j < original_mc.width/pixelSize; j++) {

	var commaTile_mc = new commaTile();

    commaTile_mc.x = j * commaTile_mc.width;

    commaTile_mc.y = i * commaTile_mc.height;

	commaTile_mc.addEventListener(MouseEvent.ROLL_OVER, onRoll);









function onRoll(e:MouseEvent):void  {


	e.currentTarget.alpha = 0.5;






//pixelated_mc.mask = commaHolder_mc;

Open in new window

Question by:jsuissa
    LVL 11

    Expert Comment

    i am not sure if i understand your question.
    are you basically asking. if you can save the
    data generated when you export your swf back to the fla?


    Author Comment

    Exactly -- that's what we are trying to figure out.

    Almost like exporting a bitmap which I know you can do.

    Just can you do the same thing with vector data to an FLA or export it to a brand new SWF?


    LVL 11

    Accepted Solution

    Action script cannot effect changes in external items(file formats) without a
    third party program or script such as PHP. but even then exporting data
    back to the original flalibrary file wont be possible.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
    This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
    In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
    The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now