Loading an external image (from file system) to fla library as MovieClip symbol.

Hi everyone,
I am new to actionscript and Flash.
I have been working on code updation project wherein initially we had an image and text as movieclips in fla library. The image and the text are read by the actionscript program which then creates an animation.
For Example:
// Picture
// _imageMC: Name of the Movie Clip in the libary which
// contains the picture.
var _imageMC:String = "polaroid";
This is later on used by another actionscript class as follows to finally create the animation.
var _mcPolaroid:MovieClip = this._mcBg.attachMovie(this._polaroid, "polaroid_mc", this._mcBg.getNextHighestDepth());
Now the problem here is when one needs to update the image or text, one needs to go and open the fla file andmanually change the image attached to the movieClip (polaroid).
I want to ease the updation process by giving the url of the image in an XML file. Read the image url from the xml and load this image in the library of the fla as movieclip. This, i think, will result in less code change and improve the updation of the final animation image.
The problem i am facing is not been able to figure out how can i change the image (after fetching its URL) to a movieclip and then load it in the library?
Thank you kindly in advance,
Varun

This is the AS3 forum and you are posting with regards to AS2 code.  Try posting in the AS2 forum...
http://forums.adobe.com/community/flash/flash_actionscript
As for the solution you seem to want.  You cannot dynamically add something to the library during runtime.  To add an image during runtime you would need to use the MovieClip.loadMovie() or MovieClipLoader.loadClip() methods.  You could have the movieclip pre-arranged in the library, but to add the image dynamically via xml information you need to load it into a movieclip, not the library.

Similar Messages

  • Loading an external image (from file system) to fla library as MovieClip symbol using ActionScript.

    Hi everyone,
    I am new to actionscript and Flash.
    I have been working on code updation project wherein initially we had an image and text as movieclips in fla library. The image and the text are read by the actionscript program which then creates an animation.
    For Example:
    // Picture
    // _imageMC: Name of the Movie Clip in the libary which
    // contains the picture.
    var _imageMC:String = "polaroid";
    This is later on used by another actionscript class as follows to finally create the animation.
    var _mcPolaroid:MovieClip = this._mcBg.attachMovie(this._polaroid, "polaroid_mc", this._mcBg.getNextHighestDepth());
    Now the problem here is when one needs to update the image or text, one needs to go and open the fla file andmanually change the image attached to the movieClip (polaroid).
    I want to ease the updation process by giving the url of the image in an XML file. Read the image url from the xml and load this image in the library of the fla as movieclip. This, i think, will result in less code change and improve the updation of the final animation image.
    The problem i am facing is not been able to figure out how can i change the image (after fetching its URL) to a movieclip and then load it in the library?
    Thank you kindly in advance,
    Varun

    The following was my attempt: (i created a new MovieClip)
    this.createEmptyMovieClip("polaroidTest", this.getNextHighestDepth());
    loadMovie("imagefile.jpg", polaroidTest)
    var _imageMC:String = "polaroidTest";
    This mentioned variable _imageMC is read by a MovieClip class(self created as follows)
    /////////////////////////////// CODE STARTS //////////////////////////////////////
    class as.MovieClip.MovieClipPolaroid {
    private var _mcTarget:MovieClip;
    private var _polaroid:String;
    private var _mcBg:MovieClip;
    private var _rmcBg:MovieClip;
    private var _w:Number;
    private var _h:Number;
    private var _xPosition:Number;
    private var _yPosition:Number;
    private var _border:Number;
    * Constructor
        function MovieClipPolaroid(mcTarget:MovieClip, polaroid:String) {
    this._mcTarget = mcTarget;
    this._polaroid = polaroid;
    init();
    * initialise the polaroid movieclip and reflecting it
        private function init():Void {
    this._border = 10;
    this.initSize();
    this.setPosition(48,35);
    this.createBackground();
    var _mcPolaroid:MovieClip = this._mcBg.attachMovie(this._polaroid, "polaroid_mc", this._mcBg.getNextHighestDepth());
    _mcPolaroid._x = _border;
    _mcPolaroid._y = _border;
    var _rmcPolaroid:MovieClip=this._rmcBg.attachMovie(this._polaroid,"rpolaroid_mc", this._rmcBg.getNextHighestDepth());
    _rmcPolaroid._yscale *=-1;
    _rmcPolaroid._y = _rmcPolaroid._y + _h + _border ;
    _rmcPolaroid._x =_border;
    * create the background for the polaroid
    private function createBackground():Void {
    this._mcBg = _mcTarget.createEmptyMovieClip("target_mc",_mcTarget.getNextHighestDepth());
    this._rmcBg = _mcTarget.createEmptyMovieClip("rTarget_mc", _mcTarget.getNextHighestDepth());
    fill(_mcBg,_w+2*_border,_h+2*_border,100);
    fill(_rmcBg,_w+2*_border,_h+2*_border,10);
    placeBg(_mcBg,_w+2*_border,_yPosition);
    placeBg(_rmcBg,_w+2*_border,_h+2*_border+_yPosition);
    * position the background
    private function placeBg(mc:MovieClip,w:Number,h:Number) : Void {  
        mc._x = Stage.width - w - _xPosition;
    mc._y = h;
    * paint the backgound
    private function fill(mc:MovieClip,w:Number,h:Number, a:Number): Void {
    mc.beginFill(0xFFFFFF);
    mc.moveTo(0, 0);
    mc.lineTo(w, 0);
    mc.lineTo(w, h);
    mc.lineTo(0, h);
    mc.lineTo(0, 0);
    mc.endFill();
    mc._alpha=a;
    * init the size of the polaroid
    private function initSize():Void {
    var mc:MovieClip =_mcTarget.createEmptyMovieClip("mc",_mcTarget.getNextHighestDepth());
    mc.attachMovie(this._polaroid,"polaroid_mc", _mcTarget.getNextHighestDepth());
    this._h = mc._height;
    this._w = mc._width;
    removeMovieClip(mc);
    mc = null;
    * sets the position of the polaroid
    public function setPosition(xPos:Number,yPos:Number):Void {
    this._xPosition = xPos;
    this._yPosition = yPos;
    * moving in
    public function moveIn():Tween {
    var mc:MovieClip = this._mcTarget;
    mc._visible=true;
    var tween:Tween = new Tween(mc, "_x", Strong.easeOut, 0, 0, 1, true);
    var tween:Tween = new Tween(mc, "_y", Strong.easeOut, 200, 0, 1, true);
    var tween:Tween = new Tween(mc, "_xscale", Strong.easeOut, 30, 100, 1, true);
    var tween:Tween = new Tween(mc, "_yscale", Strong.easeOut, 30, 100, 1, true);
    var tween:Tween = new Tween(mc, "_alpha", Strong.easeOut, 0, 100, 1, true);
    return tween;
    * moving in
    public function moveOut():Tween {
    var mc:MovieClip = this._mcTarget;
    var tween:Tween = new Tween(mc, "_alpha", Strong.easeIn, 99, 0, 1, true);
    var tween:Tween = new Tween(mc, "_x", Strong.easeIn,0, 1000, 1, true);
    var tween:Tween = new Tween(mc, "_y", Strong.easeIn, 0, -50, 1, true);
    var tween:Tween = new Tween(mc, "_xscale", Strong.easeIn, 100, 50, 1, true);
    var tween:Tween = new Tween(mc, "_yscale", Strong.easeIn, 100, 50, 1, true);
    return tween;
    /////////////////////////////// CODE ENDS ///////////////////////////////////////
    As in the current case, the name of the movieclip which has the image (originally polaroid) is being read through the variable _imageMC which we hadd given the value "polaroidTest".
    The animation shows no image even when i have inserted the correct url (i m sure this step isn't wrong).
    Any clues?

  • How to read some images from file system with webdynpro for abap?

    Hi,experts,
    I want to finish webdynpro for abap program to read some photos from file system. I may make MIMES in the webdynpro component and create photos in the MIMES, but my boss doesn't agree with me using this way. He wish me read these photos from file system.
    How to read some images from file system with webdynpro for abap?
    Thanks a lot!

    Hello Tao,
    The parameter
       icm/HTTP/file_access_<xx>
    may help you to access the pictures without any db-access.
    The following two links may help you to understand the other possibilities as well.
    The threads are covering BSP, but it should be useful for WebDynpro as well.
    /people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    http://help.sap.com/saphelp_sm40/helpdata/de/c4/87153a1a5b4c2de10000000a114084/content.htm
    Best regards
    Christian

  • How to load images from file system and save in database

    Hello Fellows!
    I have a problem and try to explain:
    Plateform:
    Operating System: Windows 98, Form 6i and Oracle 8
    Table in the database
    Table:Emp_pic with columns i.e. (empno and pic type long raw)
    In forms, I have a data block which contain the columns of the emp_pic table and a control block which have a push button contains the trigger as follow, also attach PL/SQL library i.e. D2kWUTIL.PLL
    When-Button-Pressed (Trigger)
    Declare
    temp varchar2(400);
    Begin
    temp := win_api_dialog.open_file('Open File','d:\pic','*.tif',true,win_api.ofn_flag_default,false);
    read_image_file(temp,'tif','emp_pic.pic');
    end;
    The problem when I pressed the button it does not display open dialog box what is the wrong with the code or else.
    Thanks in advance
    (BASIT)

    What do you mean "it did not work"? You need to post more information, such as what errors you got.
    My guess is that it did work, but it ran on the middle tier, which is where Forms is running. Commands like that need more work to execute on the client.
    Go to the Forms area on OTN and download the Oracle9i Forms Samples. They have demos and source code to move files from the client to the server.
    Coming soon will be a utility called WebUtil which will make this even easier.
    Regards,
    Robin Zimmermann
    Forms Product Management

  • Why can't I load plugins from file system ?

    Hello.
    Why can't I load plugins from file system, fore development sake for ex. ?
    Thx.
    Andrew.

    For security reasons, the Flash Player doesn't allow applications to access both the file system and the network.
    One workaround is to compile the plugins in statically (rather than load them dynamically).  The Akamai Plugin Sample shows you how to load plugins either way, you can see the source here: http://opensource.adobe.com/svn/opensource/osmf/trunk/apps/samples/plugins/AkamaiPluginSam ple/.

  • Can load image from file using LabVIEW and display on IMAQ graph?

    I dont have IMAQ Vision for LabVIEW on my computer. Is it possible to load image file and display on an IMAQ graph?
    Thanks!

    Hey werwr,
    In response to: "I dont have IMAQ Vision for LabVIEW on my computer. Is it possible to load image file and display on an IMAQ graph?"
    As of right now, in order to read an image from file, you actually do need the IMAQ Vision software. The IMAQ driver without the Vision VI's will allow you to collect images from a framegrabber, and it will allow you to save those images to file. But the function that allows you to read an image from file does require the Vision VI's. Once you have the VI to read images from a file, you will be able to display the image on an IMAQ "Graph" or otherwise known as an Image Display.
    I hope this helps. Please let me know if you have any further questions.
    Thanks,
    DJ
    Applications Engineer
    National Instruments

  • Q: InDesign Extension could not be removed from file system when it was removed in Extension Manager

    <body>
    <p>All files of an ordinary extension will be removed from file system when this extension is removed in Extension Manager. But InDesign extensions with <tt>"plugin-manager-type"</tt> attribute in mxi file are special. Extension Manager will NOT remove files of this kind of extensions from file system when removing these extensions. Instead, Extension Manager will use other way to tell InDesign not to load these removed extensions when InDesign is launched. If you want to make your InDesign extensions removable, you can just remove <tt>"plugin-manager-type"</tt> attribute from the mxi file when you generate an extension.</p>
    </body>

    Thanks for the help. Yes that addressed the issue.
    On a side note, the tutorial I followed was the one that came with the plugin. Specifically I'm referring to the following file:
    //<eclipse_path>/plugins/com.adobe.cside.html.docs_1.0.0.201307260955/doc/getting_started/ Create_Your_Own_HTML5_Extension_In_5_Minutes.htm
    This is the HTML page for the "Create Your Own HTML5 Extension In 5 Minutes" walkthrough. It makes no mention of changing "PlayerDebugMode". I downloaded the eclipse plugin from the following link:
    http://labs.adobe.com/downloads/extensionbuilder3.html
    Is there a more up to date plugin? Where is the documentation that references changing the settings you mentionned?

  • Store \ Retrieve files from file system

    Hi to all!
    I would like to implement a solution for storing files uploaded via apex user interface to servers file system. As well I would like this files to be retrievable by apex users. I designed the following solution:
    For upload:
    1. Through file browse item user chooses file to be uploaded
    2. File goes to custom table (as BLOB)
    -- so far i would use apex Upload\Download files tutorial
    3. File(BLOB) would then have to be written to file system to some directory and file id would have to be written to some db table which holds pointers to files on file system
    4. delete file(blob) from custom table (from step 2)
    For download:
    1. user chooses link from some report region(based on table giving file pointers to files residing on file system)
    2. file identified with chosen file pointer is then inserted into blob column of some custom table in db
    3. from custom table with download procedure fie is finally presented to user
    4. delete file(blob) from custom table (from step 2)
    Using apex tutorial for Upload\Download files it is straitforward to get the files from db table or into db table using blobs. But i have not seen any example of using BFILE or migrating files from db to file system and vice versa.
    So some Q arise:
    a) How can I implement step 3 under For upload section above
    b) How can I implement step 2 under For download section above
    c) Is there any way to directly upload file to file system via apex user interface or to directly download file from file system via some report region link column?
    Please help!!!
    Regards Marinero
    Message was edited by:
    marinero

    marinero,
    Here is a procedure that will copy an uploaded file to the file system:
      Procedure BLOB_TO_FILE(p_file_name In Varchar2) Is
        l_out_file    UTL_FILE.file_type;
        l_buffer      Raw(32767);
        l_amount      Binary_Integer := 32767;
        l_pos         Integer := 1;
        l_blob_len    Integer;
        p_data        Blob;
        file_name  Varchar2(256);
      Begin
        For rec In (Select ID
                              From HTMLDB_APPLICATION_FILES
                             Where Name = p_file_name)
        Loop
            Select BLOB_CONTENT, filename Into p_data, file_name From HTMLDB_APPLICATION_FILES Where ID = rec.ID;
            l_blob_len := DBMS_LOB.getlength(p_data);
            l_out_file := UTL_FILE.fopen('UPDOWNFILES_DIR', file_name, 'wb', 32767);
            While l_pos < l_blob_len
            Loop
              DBMS_LOB.Read(p_data, l_amount, l_pos, l_buffer);
              If l_buffer Is Not Null Then
                UTL_FILE.put_raw(l_out_file, l_buffer, True);
              End If;
              l_pos := l_pos + l_amount;
            End Loop;
            UTL_FILE.fclose(l_out_file);
        End Loop;         
      Exception
        When Others Then
          If UTL_FILE.is_open(l_out_file) Then
            UTL_FILE.fclose(l_out_file);
          End If;
      end; And here is a procedure that will download a file directly from the file system:
      Procedure download_my_file(p_file In Number) As
        v_length    Number;
        v_file_name Varchar2(2000);
        Lob_loc     Bfile;
      Begin
        Select file_name
          Into v_file_name
          From UpDownFiles F
         Where File_id = p_file;
        Lob_loc  := bfilename('UPDOWNFILES_DIR', v_file_name);
        v_length := dbms_lob.getlength(Lob_loc);
        owa_util.mime_header('application/octet', False);
        htp.p('Content-length: ' || v_length);
        htp.p('Content-Disposition: attachment; filename="' || SUBSTR(v_file_name, INSTR(v_file_name, '/') + 1) || '"');
        owa_util.http_header_close;
        wpg_docload.download_file(Lob_loc);
      End download_my_file;I could put a sample application on apex.oracle.com, but it wouldn't be able to access the file system on that server.

  • What is the best way to copy aperture library on to external hard drive? I am getting a message that say's "There was an error opening the database. The library could not be opened because the file system of the library's volume is unsupported".

    What is the best way to copy aperture library on to external hard drive? I am getting a message that say's "There was an error opening the database. The library could not be opened because the file system of the library's volume is unsupported". What does that mean? I am trying to drag libraries (with metadata) to external HD...wondering what the best way to do that is?

    Kirby Krieger wrote:
    Hi Shane.  Not much in the way of thoughts - - but fwiw:
    How is the drive attached?
    Can you open large files on the drive with other programs?
    Are you running any drive compression or acceleration programs (some drives arrive with these installed)?
    Can you reformat the drive and try again?
    Hi Kirby,
    I attached the UltraMax Plus with a USB cable. The UltraMax powers the cable so power is not an issue. I can open other files. Also, there is 500GB of files on the drive so I cannot re-format it. Although, I noted I could import the entire Aperture Library. However, I do not want to create a duplicate on my machine because that would be defeating the purpose of the external drive.
    Thanks,
    Shane

  • Read image from file

    Dear all,
    I would like to know how to read a gif or jpeg image from file to a binary stream?
    So that I can transfer through the internet using a http POST request.
    Thank you very much.

    Use FileImageInputStream.. See api docs for further reference
    Cheers
    -P

  • (HELP) - Loading multiple external images error #1010

    I'm a newbie at Flash and spent the whole day trying to fix this one problem and can't seem to fix it no matter what I do.
    I'm using Action Script 3.0, CS5 on Windows 7.
    I'm trying to load two external images (thumbnail images) in the loader "see image below for reference", where the full image size will be. However, I am getting this error when testing my movie. What am I doing wrong?
    Test Movie error message:
    "port1_btn
    TypeError: Error #1010: A term is undefined and has no properties.
        at index_fla::MainTimeline/fl_MouseClickHandler_6()"
    "port2_btn
    TypeError: Error #1010: A term is undefined and has no properties.
        at index_fla::MainTimeline/fl_MouseClickHandler_7()"
    FYI:
    Loader instance name: mainLoader
    Thumbnail #1 instance name: port1_btn
    Thumbnail #2 instance name: port2_btn
    This is my code

    Go into your Flash Publish Settings and select the option to Permit Debugging.  Then the error messages could include an indication of which lines are causing the problem.
    And just for the sake of asking since the code is somewhat minimal... is the mainLoader inside a container named portfolioBkgd?

  • Trying to make a iPhoto Library on my external hard drive but I get "the library could not be opened because the file system of the library's volume is unsupported.

    Trying to make a iPhoto Library on my external hard drive but I get "the library could not be opened because the file system of the library's volume is unsupported."  I reformatted my hard drive to ExFAT because I want to be able to use it on PC and MAC.
    iOS: 10.10.1
    Mac Book Air
    External: WD 500 GB recently reformatted (no files on it currently)

    The iPhoto library must only be on a volume formatted Mac OS extended (journaled) - it can not be on any other format drive
    LN

  • Issue from file system

    <font face="Times New Roman" color="35349F" size="3">
    Hi,
    during the setup of R12, there are some messages from File system
    http://dl.dropbox.com/u/40211031/f135.jpg
    the messages are in this log
    http://dl.dropbox.com/u/40211031/log2.txt
    how to resolve this?
    </font>

    Hua,
    during the setup of R12, there are some messages from File system
    http://dl.dropbox.com/u/40211031/f135.jpg
    the messages are in this log
    http://dl.dropbox.com/u/40211031/log2.txt
    how to resolve this?What is your OS?
    Can you click on the file system icon and see what is the error?
    Thanks,
    Hussein

  • How to migrate 11gr2 standby database from file system to ASM

    Hi,
    I have 11gR2 data guard setup of 2 node RAC primary and stand alone standby database.
    Primary RAC uses ASM, and stand alone standby DB uses normal file system for data files and archive logs. I want to migrate the stand alone standby DB from file system to ASM.
    If you have any ideas or documents on it, kindly please share with me.
    Thanks in advance,
    Mahipal

    Mahi wrote:
    Hi Fran,
    Thanks a lot for the quick reply. I have another question, I want to have standby in ASM; but ASM home is grid home(CRS+ASM) in 11gr2.
    I don't want to configure CRS now for standby, only want to have ASM storage. s it possible to install the grid home only for ASM and not for CRS?
    On a stand-alone system, there are still CRS/Grid components that are a part of the ASM install. You cannot NOT install it.
    >
    Thanks,
    Mahi

  • IPhoto9: "library could not be opened because the file system of the library's volume is unsupported."

    Can please anyone help me with this issue.
    After upgrading from iPhoto8 to iPhoto9 my library won't open anymore. I have stored all my pictures on a NAS (Buffalo Link Station Duo). It all worked fine but since upgrading to iPhoto9 I do have the following problem:
    When opening iPhoto I receive a message that the library needs to be updated. I assume that iPhoto should just do this sort of automatically in order to upgrade to iPhoto9.However, next message I receive then is
    "The library could not be opened because the file system of the library's volume is unsupported."
    Apple support so far does not seem to be able to solve my issue. Anyone else having had the same issue and having a solution to this?
    Thanks a lot for your help.

    There is no solution.
    IPhoto needs to have the Library sitting on disk formatted Mac OS Extended (Journaled). Users with the Library sitting on disks otherwise formatted regularly report issues including, but not limited to, importing, saving edits and sharing the photos.While you have been lucky to date, many folks with a library on a NAS found that it worked for a while and then the problems started.
    Workaround: Put the Library on a Disk Image formatted Mac OS Extended (Journaled) and store that on the NAS. But the real solution is to use a properly formatted disk for the Library.
    Regards
    TD

Maybe you are looking for

  • JComboBox Cell Editor in JTable

    I've scouered the forums for an answer to my question, and while finding other valuable advice, I have yet to find an answer to my question. But first, a little description: I have a JTable consisting of 5 columns: col1= standard Object cell editor c

  • How to get the IPC SP number?

    Hi guys, I try to connect CRM 4.0 system to IPC. The connection test worx fine, but from CRM system in during usage we get following error: SPC_SERVER_ERROR v PRC_INT_CREATE this is solved in the following link IPC Dispatcher Error My question is, ho

  • Movie Error

    I purchased and downloaded "The Italian Job (2003)" to my iTunes and iPod. However, whenever I try to play the movie, I get to the end of the opening credits and the movie stops. My iTunes tells me that I have an error and I exit the application. On

  • Verifaction log-invoice /2011

    hi all I ve a problame while doing miro in (third party process) everything is ok it calcullating the tax even but while simulating it show the window but couldnt post.while clicking the message box it shows an error stating that-ACCOUNT 892000 HAS B

  • Aperture + Canon Wireless File Transmitter WFT-E4 A?

    Hi guys, I was wondering if you could help me out with something? I have a Canon EOS 5D mkll and am looking at purchasing the Canon Wireless File Transmitter WFT-E4 A, my question is, am i able to wirelessly tether RAW images using this transmitter d