[Q] duplicating movieclip with loaded external jpg file

Hi, Im trying to make thumbnail and enlarged picture by
duplication.
What i tried was using duplication of thumbnail movieclip
which jpg image is loaded
However it seems not working as i intended,so I had to make
empty movieclip and loaded image again!!!
I am concerning that if I use new movieclip and loading the
image again..it means users have to download the same image twice.
Basically, I am trying to make a list of thumbnailed images
with enlarged picture popes up when mouse rolls over them
Is there any proper way to make it happen?
or duplication just doesnt work even thou movieclip is
already loaded with image?
Thank you for your time~

> simple create your movieclip. Now create an empty clip
inside. You will
load
> your JPG in the empty clip. This one can't be
duplicated, but you will be
able
> to duplicate its parent. Like that:
> myMc.anEmptyClip.loadMovie("blabla.jpg");
> myMc.duplicateMovieClip("theNameYouWant",
levelNumYouWant);
>
> That will works.
No, that will not work
You are partly right - if you create a nested clip and assign
properties
(such as an onPress handler) to the parent clip, you can then
load content
into the child without overwriting the parent's properties.
If you load an
image into the child and then duplicate the parent however,
the image in the
child clip *will not be duplicated*. Try it.
> 2- Also, the way you where going to do, works too. yes
the user will have
to
> load it again, but it is already in the Browser Cache.
It means that will
load
> quickly the second time and after that. Bad side is more
that you will
doble
> the bandwidth of the images loading on your site.
Again, partly right. Lets take it bit by bit:
> yes the user will have to
> load it again, but it is already in the Browser Cache
The movie will have to load it again, but will probably load
it from cache.
> Bad side is more that you will doble
> the bandwidth of the images loading on your site.
Not so. If it's in the cache, it doesn't use any bandwidth at
all - that's
what caching means! A copy of the image is saved on the
user's local hard
drive, so no bandwidth needs to be used when loading from
cache.
Basically, for the *majority* of users, loaded images will be
cached (this
is dependent on browser settings, but most users will have
their browsers
set to cache). This means that after the first load,
subsequent loads of the
same image will be quick and carry no bandwidth overheads.
The real issue here is that dynamic content in movieClips,
such as loaded
images, swfs, or graphics created with the drawing API will
not duplicate
when the clip is duplicated/ The accepted work around used to
be simply to
reload the aimge. Now with Flash 8 though you can use the
BitmapData class
to grab a copy of the image and redraw it to the newly
created clip if you
so wish.
Pete
Remove '_spamkiller_' to mail

Similar Messages

  • Vista problem with loading external JPGs?

    I'm really pulling my hair out on this one. I did a quick
    flash piece for a preschool's web site and have tried several
    different Flash components inside of a larger FLA file that load
    external JPG files in a predefined area. With each component, I
    have received complaints (so far only from Vista users) that the
    user sees nothing in the area where photos are supposed to be
    loading. Instead they just see a white or black box.
    Is there any known issue with this? They can see everything
    else in the SWF file (the swinging girl and the text), but not any
    of the loaded JPG photos. Can anyone else out there with Vista tell
    me that they have the same problem? I'd like to track down what the
    common denominator is.
    I've asked two of the users to completely uninstall the Flash
    player and reinstall it, but to no avail. Deactivating Norton
    Antirvirus also didn't seem to do anything.
    Here is the URL:
    http://www.countryvillageps.com
    -- the flash item is the top banner.

    As Ned said the problem might be with the file structure on the server. Other problems may be with spelling. You computer may not be case sensitive to the names of the .swf files that you are loading, but your server might. So, on your computer when you are testing, second.swf is the same as Second.swf, or even second.SWF. But, on the server each of these variations is seen as a different file. Another problem is that when you are loading files from the same computer in testing, those files are close and so they load very quickly from your computer. When the files have to travel from the server, there will likely be a measurable period of time before the file is ready to be shown. This is particularly problematic with video that is embedded into an .swf. The whole file will need to be downloaded and uncompressed before it is available to play. If you stream the video as an external file, you can shorten the wait considerably.

  • Can you load external jpg files

    Is there a way to load external .jpg files on the fly or do
    they have to reside in the swf file?

    Hi Persons,
    macrofireball is correct as always, but I'll just add a
    thought to this thread because I suspect "rfull" isn't actually
    asking what he/she
    appears to be asking.
    No photo can ever be displayed "by itself". That is, image
    files are always "opened" in some sort of vehicle. It might be an
    image editor, or it might be a document like a *.DOC or a *.HTM ...
    but
    something must "contain" the image.
    So you can access a photo at any time you wish by putting it
    on a web page, then linking to the web page (for instance). Is
    something like that what you really had in mind?
    Have a good 'un folks!
    .

  • Trouble with loading external mp3 files

    I apologize for the length of the post. I hope this is clear
    of what I am trying to explain.
    My problem deals with getting "undefined" when I press a
    button to load an external mp3 files. The following is what my XML
    childNode looks like:
    <option phonetic="Soundless, or A" name="aleph"
    cursive="alephCursive.swf" block="alephBlock.swf"
    audio="char1.mp3"/>
    Every attribute loads the way I've programmed them, except
    for the last one "audio".
    The following is what my actionscript looks like loading in
    these attributes:
    Everything is happening inside the onLoad event for my XML
    file.
    var xmlContent = this.firstChild.firstChild;
    audioContent = new Array();
    for (var i = 0;
    i<this.firstChild.firstChild.childNodes.length; i++) {
    nextEntry = xmlContent.childNodes
    audioContent = [nextEntry.attributes.phonetic,
    nextEntry.attributes.name, nextEntry.attributes.cursive,
    extEntry.attributes.block, nextEntry.attributes.audio];
    The code above simply adds each attribute to the audioContent
    array. Each element traces out correctly.
    The following code is how I am using these attributes:
    for (var i = 0; i<audioLength; i++) {
    audioContainer.attachMovie("container4", "audioItem"+i, i);
    // Create a shortcut reference to the present movie clip
    thisClip = audioContainer["audioItem"+i];
    thisClip.myTxt1.htmlText = audioContent[0];
    thisClip.myTxt2.htmlText = audioContent
    [1];
    thisClip.cursive_mc =
    loadThis(assetPath+audioContent[2], thisClip.cursive_mc);
    thisClip.block_mc = loadThis(assetPath+audioContent
    [3], thisClip.block_mc);
    thisClip.speaker_mc.attachMovie("speaker", "speaker_mc",
    this.getNextHighestDepth());
    thisClip.speaker_mc.speaker_mc.onRollOver = function() {
    this.nextFrame();
    thisClip.speaker_mc.speaker_mc.onRollOut = function() {
    this.prevFrame();
    thisClip.speaker_mc.speaker_mc.onRelease = function() {
    mySnd.loadSound(audioPath+audioContent[4],true);
    Loading the text works inside the htmlText. Using a function
    loadThis to load external swf files works corerctly and even
    attaching a linked movieclip from my library called "speaker" works
    correctly.
    The problem comes from pressing the speaker movieclip that
    the output traces "undefined" instead of the external mp3 file.
    I appreciate any help. Thanks.

    As Ned said the problem might be with the file structure on the server. Other problems may be with spelling. You computer may not be case sensitive to the names of the .swf files that you are loading, but your server might. So, on your computer when you are testing, second.swf is the same as Second.swf, or even second.SWF. But, on the server each of these variations is seen as a different file. Another problem is that when you are loading files from the same computer in testing, those files are close and so they load very quickly from your computer. When the files have to travel from the server, there will likely be a measurable period of time before the file is ready to be shown. This is particularly problematic with video that is embedded into an .swf. The whole file will need to be downloaded and uncompressed before it is available to play. If you stream the video as an external file, you can shorten the wait considerably.

  • [Q] Loading one external JPG file into different MCs & Downloading

    Hi, I was wondering if I set few MCs to load the same
    external JPG file, would users need to download thme few times?
    Or only need to download once?
    I am having trouble loading long 700*8000 jpg files due to
    limited pixel size of 2300(?).
    I was thking of making them into 2000 * 2000 square pictures
    by cutting long picture into short sigments and putting them side
    by side.
    and using AS to make them appear as single long picture by
    using 2 MCs with same image but at different x position of loaded
    square Picture.
    Anyone have better idea?
    I am bit hesitated to make jpg to swf files cuz I have too
    many pictures
    Plz spare some time for me..
    Thank you for your time~!!!!

    thank you, kglad..
    I was thking of making 700 * 8000 image into 2800*2800 image
    this square picture works as four (700*2800) images.
    So that i can use 2 set of same jpg MC with differnt Masking
    to make them
    appears as continuously long images
    eg. 1st Mc will be showing _x: 0-700
    at the bottom of the first MC, 2nd MC will be showing _x:
    700-1400
    and so on so on..
    so..when user is scrolling down..these MCs will makeing
    sqaure image
    as long portrait image..
    I dont beleve myself it is a good solution..
    Probably most suitable way would be what you just suggested
    me..
    Its just that it will be quite a time consuming job to make
    jpgs into swfs...
    Thank you again for your kindness..:)

  • As3 loaded external jpgs

    developing a ui in flash for photo gallery which I am loading
    into dreamweaver.
    using as3 in flash to load external photo files so not all
    having to download on opening.
    have had no problem in dreamweaver with swfs with embedded
    jpgs.
    ui comes up in dreamweaver but not external files. even
    though when I open swf movie or the flash created html of same
    file, on its own, no prob.
    anyone run across this problem, jpgs are in same file as
    flash media, also dropped them into image file just in case that
    might work---no go
    any ideas ?

    your isse begins here ..
    loadSection()
    you use the same loader to not only load files but you are tyring to use it to target the movieClip you also want to play.
    The issue is loader.  The loader can only reference one load at a time.. otherwise you screw up your listeners and the ability to unload files properly.
    You should load all files in Your current system as its own variable so that while one loads you can still control a movie.
    So what type of end transitions do your files have?
    What exactly with this seems like youre getting an issue.. looking at it looks alright aside from the fact that some methods are not used at all by your class

  • Load external jpg

    I cannot load external jpg, they're not progresive.... the
    jpg files are inside a folder, and I write the next code:
    this.createEmptyMovieClip("mc", 100);
    mc.loadMovie("flash/photo1.jpg");
    but it doesn't work...
    Thanks

    use trace(mc) to confirm "this" refers to a movieclip, make
    sure there's nothing at a greater depth preventing you from seeing
    your image, double check your spelling of flash/photo1.jpg (and
    case counts) and make sure your html file is in a super folder of
    the flash folder, if you're testing in a browser.

  • Using Flashvars to load external mp3 files

    I am trying to find a very good step by step tutorial on using "Flashvars" to load external mp3 files, I have been searching on google and the many I have found fall short in some way or another. From what I have been able to gather, I have tried using the code in red (commented out), which works, and modify it to use "Flashvars". The code that works, the mp3 file is hard coded, but my goal is to use "Flashvars" which I am attempting to do in the code following the code in red. I am also including the html code. Any help will be greatly appreciated.
    Thanks,
    David
    var soundReq:URLRequest = new URLRequest("mardi_gras2.mp3");
    var sound:Sound = new Sound();
    sound.load(soundReq);
    sound.addEventListener(Event.COMPLETE, onComplete);
    function onComplete(event:Event):void
        sound.play();
    var soundReq:URLRequest = new URLRequest(root.loaderInfo.parameters.audio);
    var sound:Sound = new Sound();
    sound.load(soundReq);
    sound.addEventListener(Event.COMPLETE, onComplete);
    function onComplete(event:Event):void
        sound.play();
    HTML CODE
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="mySoundvars" align="middle">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="false" />
        <param name="movie" value="mySoundvars.swf" />
       <param name="FlashVars" value="audio=mardi_gras2.mp3" />
        <param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />    <embed src="mySoundvars.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="mySoundvars" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" FlashVars="audio=mardi_gras2.mp3" />

    Ok waterlovinguy,
    I went back to my original code, and I got things to work... I think my whole issue was with the HTML CODE. So I decided to use the "SWFObject generator". I had never used it before, frankly I had never heard of it until I started my searches on "Flashvars".
    Thank you very much for all your assistance, PEACE,
    David
    Final Codes below
    var my_var:String = new String();
    my_var = root.loaderInfo.parameters.myflashvar;
    myText.text = my_var;
    var soundReq:URLRequest = new URLRequest(root.loaderInfo.parameters.audio);
    var sound:Sound = new Sound();
    var soundControl:SoundChannel = new SoundChannel;
    sound.load(soundReq);
    play_btn.addEventListener(MouseEvent.CLICK, playSound);
    stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
    function playSound(event:MouseEvent):void
        SoundMixer.stopAll();
        soundControl = sound.play();
    function stopSound(event:MouseEvent):void
        soundControl.stop();
    HTML Code
                    <!>>
                    <!<![endif]>
                        http://www.adobe.com/go/getflashplayer
                        </a>
                    <!>>
                    </object>
                    <!<![endif]>
                </object

  • Loading external .swf files issue...

    Hi,
    I'm working on a simple example of loading external swf files with some ActionScript.
    I've placed an instance of List Component and gave it an instance name of loadList. Using Component Inspector, I assigned data for 4 external files as below:
    Next, I've added a UILoader component (instance name - loadWindow). The code that is supposed to load the content into UILoader is this:
    loadList.addEventListener(Event.CHANGE, selectItem);
    function selectItem(e:Event):void
        loadWindow.source = e.target.selectedItem.data;
    When I run it in a FlashPlayer, it only loads the first 2 swf files....  (I checked the files and all files are fine).
    I hope to get some light on the issue so any help will be appreciated.

    Try tracing e.target.selectedItem.data to make sure it's what you expect.
    Also, have you tried using the load() method instead of the source property?

  • Preloader whilst loading external .jpg

    This is the script I use to load external .jpgs into a site
    btn1.onRelease = function (){
    loadMovie("Bike.jpg", _root.photo.empty);
    _root.stick.gotoAndStop(80);
    How would I create script so that it creates a sepaprate
    preloader whilst each image is loading.

    for something like this it's best to use the MovieClipLoader
    class, rather than loadMovie() - doing so will allow you to use the
    onLoadPrgress handler to update the preloader while it's being
    loaded. it would go something like this:

  • Load a JPG file

    Hello, how can I load a JPG file (or BMP , or whatever) and print it on the screen?
    Any kind of answer will be appreciated!
    Thank you

    stick the image in the same dir as the .class file and do:
    Image myimage = Toolkit.getDefaultToolkit().getImage("myjpg.jpg");then display the image.

  • AS3 loading external swf files with buttons from inside a movieclip

    In my main .swf I have labels on the timeline, navs for those btns are on the first frame of the AS layer and each button sends the playhead to a different frame.
    On one frame called fr1 there is an mc called mc_1 that appears on stage when the playhead stops there. Inside mc_1 are a set of navigation buttons that need to call external .swfs.
    Do I add event listeners on the last frame of mc_1 for each button?
    how do I call the loaders for the swfs on the buttons since the swfs will load on the main timeline NOT the mc_1 timeline?
    So label on main timeline called fr1 will load external1 swf , on fr10 external 2.swf will load and so on.
    any help?

    The code for that button's event listener needs to be placed wherever it has direct access to the button.  Not necessarily on the same timeline, but in a place where both the button and the code are present at the same time.
    The code could be placed at the frame in the main timeline where the movieclip with the button(s) is, targeting the buttons via the movieclip (mc.button.addEvemtListener...) , unless the buttons are somewhere down the timeline of that movieclip.
    If they are down the timeline of that movieclip, then you would need to have the event listener also inside the movieclip, down its timeline where the buttons are finally settled in... being sure to assign instance names to the buttons at every keyframe.

  • Need to load external jpgs at once

    I am using loadMovie to load all my external jpgs at once. On
    start I have thumbnails which animates, and using loadMovie load
    jpgs into that thumbnails. Offline it works fine, but online it
    only loads few jpgs first with animation and rest loads without
    animation just blink and loads. can you help me out for this.
    this is my sample page link:
    http://suewong.yourdemowebsite.com/editorial.htm

    Look at MovieClipLoader instead - images take time to load.
    You have to wait
    until your files have loaded before trying to use them - MCL
    is best for
    that, with its onLoadInit method.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Loading from library conflicts with loading external swf

    I'm very new to ActionScript, so this might be incredibly basic. However, I've Googled and read myself into a coma and I'm not finding a solution.
    I have a movie with 6 navigation buttons.  Four of them load external .swf slideshows, and they work fine - as each file loads, the previous one clears the stage, etc.  The other button that I currently have set up is loading, from the library, an image.  The problem I'm having is that the slideshows replace each other on the stage - they're not stacking, they're replacing - but when the user selects the button that loads the image, the image overlays the last-selected slideshow.  If the user selects the image first, the image is visible when two of the external files transition.  Because of that 6th button, which is not yet even started, it's not desirable to me to simply set up the single image as another external file; if it's at all possible, I need to be able to pull from a library file when I build that last button.
    What I'd like to do - because there is no logical order that the buttons should be selected in - is figure out how to tell every button to remove the image file on click.  I've tried using this in the four buttons that link to the slideshows, to deal with the image (that's the one called quoteImage):
         if(myLoader != null && contains(quoteImage)){
            myLoader.removeChild(quoteImage);
    which has the advantage of not giving me any errors, but doesn't actually fix my problem.  I've tried many, many other things, and I'm just really stumped on what exactly I need to do to make this work the way I want it to.  Based on the fact that the books and online resources I've been using don't really cover this specific example, I suspect it might be an incredibly idiot thing to do, but I'd really like it to work this way if that's possible.
    The code as it stands, with the global variables and the first two buttons (the next three are identical to the second button and the sixth button doesn't exist) looks like this:
    var myLoader:Loader=new Loader(); 
    var quoteImage:Bitmap;
    stop();
    // Loads quoteImage from library
    btnQuotes.addEventListener(MouseEvent.CLICK, showquote);
    function showquote(event:MouseEvent):void {
    var myBitmapDataObject:myBitmapData = new myBitmapData(500, 350);
    var quoteImage:Bitmap = new Bitmap(myBitmapDataObject);
    quoteImage.x=150;
    quoteImage.y=180;
    addChild(quoteImage);
    // Loads industrial.swf from external file
    btnIndustrial.addEventListener(MouseEvent.CLICK, showindustrialcontent);
    function showindustrialcontent(event:MouseEvent):void {
    var myURL:URLRequest=new URLRequest("industrial.swf");
    myLoader.x=150;
    myLoader.y=180;
    myLoader.load(myURL);
    addChild(myLoader);
    Help is very much appreciated.

    I see now how to import and display a library class object
    using:
    var MovieClipClass:Class =
    Class(loader.contentLoaderInfo.applicationDomain.getDefinition("myLibraryAsset"))
    var movieClip:Sprite = new MovieClipClass();
    addChild(movieClip)
    But this seems to only work for SWF's published for AS3 Flash
    Player 9.
    I need to do the same for SWF's published with AS2 Flash
    Player 7.
    Any ideas?

  • Loading external swf file in a new window

    Hi,
    I've got a few .swf files with video tutorials I've created using Captivate 4.
    I wanted to link them so I've created a main screen with menu with buttons in Flash.
    I've added AS to load the external swf files but they load in the same window. How can I load these .swf files in seperate window so that you could get back to the main window after you've finished watching?
    Here's my code:
    stop();
    var myLoader:Loader = new Loader();
    button1_btn.addEventListener(MouseEvent.CLICK, movie1_1);
    function movie1_1(e:MouseEvent):void
        var myURL:URLRequest = new URLRequest("01_01_Welcome.swf");
        myLoader.load(myURL);
        addChild(myLoader);
    I'm also attaching screenshot with menu in flash

    I've deleted the line and now the code lookes like that:
    stop();
    var myLoader:Loader = new Loader();
    button1_btn.addEventListener(MouseEvent.CLICK, movie1_1);
    function movie1_1(e:MouseEvent):void
        var myURL:URLRequest = new URLRequest("01_01_Welcome.swf");
        addChild(myLoader);
    Unfortunately, it doesn't load the .swf file when you click on the button...

Maybe you are looking for

  • Lost expose in 10.6?

    hi, i have a mac mini that is currently updated to 10.6.8 and have lost the ability to expose windows. when hitting that hot corner, the screen dims but no smaller thumbnails of my screens appear. I know that in later OS versions expose has been chan

  • Up-to-date page not accepting serial number

    I bought a new Mac from the Apple Online Store on 29th June.  It is all registered and showing up as such on the Applecare look-up page. When I now go to the Lion up-to-date page to try and retrieve my upgrade, it gives me the error message: "Sorry,

  • Create a VMware snapshot before promoting domain controller

    Dear expert, I have created a new guest OS in VMware ESXi 4.1 according to the following procedures:- 1. Install windows 2008 R2 standard 2. Configure network information 3. Join the server to the domain 4. Run windows update As I will promote the me

  • I have issues with 2 websites, they are not loading need help

    This is so frustrating, i have 2 new clients whos websites are working when i use the http://caesars.businesscatalyst.com/index http://caesars.businesscatalyst.com/index I have used business catalyst for other clients and i have set them up exactly t

  • How do I permanently delete an app from my ipad mini

    I am trying to delete "Secret Passages Hidden Treasures because I want to completely start over.  I've tried to delete it, but every time I add it again, it remembers where I left off.  Can anyone help?