Professional Web Applications Themes

Loading dynamicly from from Library - Macromedia Flash Actionscript

Lo all! Need some help with the actionscript syntax, id like to load some items dynamicly from the library pallete. At the moment ive only succeded to load pictures or swf files from an url or locally on my harddrive. My code is attached. Now, how on earth do i exchange the "pic1.swf" to an item in my Library? Thanks for reading! // eric //initialize slide show if( init==null ) { var init = true; //sets the app as initilized var num = 0; //The current image displayed var imageArray = new Array( "pic1.swf", "pic2.swf", "pic3.swf"); /* "http://www.eve.se/grafik/screenshots/90_med.jpg", "http://www.eve.se/grafik/screenshots/82_med.jpg", "http://www.eve.se/grafik/screenshots/72_med.jpg", ...

  1. #1

    Default Loading dynamicly from from Library

    Lo all!

    Need some help with the actionscript syntax, id like to load some items
    dynamicly from the library pallete.
    At the moment ive only succeded to load pictures or swf files from an url or
    locally on my harddrive.

    My code is attached.

    Now, how on earth do i exchange the "pic1.swf" to an item in my Library?

    Thanks for reading!

    // eric


    //initialize slide show
    if( init==null )
    {
    var init = true; //sets the app as initilized
    var num = 0; //The current image displayed
    var imageArray = new Array(
    "pic1.swf",
    "pic2.swf",
    "pic3.swf");
    /*
    "http://www.eve.se/grafik/screenshots/90_med.jpg",
    "http://www.eve.se/grafik/screenshots/82_med.jpg",
    "http://www.eve.se/grafik/screenshots/72_med.jpg",
    "http://www.eve.se/grafik/screenshots/74_med.jpg");
    */

    //Makes the initial call to the RotateImage function
    RotateImage();

    //creates a listner that calls event on this interval
    setInterval( RotateImage, 5*1000 );
    stop();
    }


    //Shows the next image in array
    function RotateImage()
    {
    if( num >= imageArray.length )
    {
    num=0;
    }

    loadMovie( imageArray[ num ], "mcImage" );
    num++;
    }

    mrmille Guest

  2. #2

    Default Re: Loading dynamicly from from Library

    to attach an item from the library, you have to make sure its linkage
    properties are set to 'export for actionscript' and 'export in first
    frame'.. also give it a sensible identifier such as 'pic1'.

    You can then attach it to the stage using actionscript using attachMovie()

    for example to make it appear in a clip on root called 'clip1',
    positioned within that clip 100 pixels in, you would use:

    _root.clip1.attachMovie("pic1","pic1_mc",1,{_x:100 });


    --
    MOLOKO
    ------------------------------------------------
    ::remove _underwear_ to reply::
    'God saves but Buddha makes incremental backups'
    ------------------------------------------------
    GCM/CS/IT/MC d-- S++:- a- C++ U--- P+ L++ !E W+++$ N++ O? K+ w+++$ !O M+
    VMS? PS+++ PE- Y PGP+ t+ 5-- X-- R* tv++ b++++ DI++++ D+ G e h-- r+ y++
    see [url]www.geekcode.com[/url] to translate the above!
    MOLOKO Guest

Similar Threads

  1. Replies: 1
    Last Post: April 26th, 06:58 AM
  2. Dynamicly Loading MP3's
    By cosmo_b in forum Macromedia Flash Sitedesign
    Replies: 1
    Last Post: April 16th, 04:11 PM
  3. Loading a movie clip from the library
    By Tommy_ro in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: February 24th, 06:03 PM
  4. Dynamicly loading images in flash?
    By ROKKSTAR in forum Macromedia Flash
    Replies: 6
    Last Post: October 8th, 06:20 PM
  5. Problem in loading JNI shared library on AIX
    By Naresh Agarwal in forum AIX
    Replies: 7
    Last Post: October 8th, 01:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139