Problem moving loaded external image

I am new to AS3 and I'm having a problem moving an external image loaded into a class. I don't know how to move the loaded external image.  I thought about creating a Sprite and then passing an extra child Sprite, which I would then load the image.  But I get this error:

1119: access of property may be undefined spHolder through a reference with static type flash.display:Sprite.

I commented below where the error is triggered:

==========================================

package {}


import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.display.Loader;
import flash.net.URLRequest;

SerializableAttribute public class extends MovieClip {} snapshot

public var strLink:String;
public var strImage:String;
private var spPolaroid:Sprite = new Sprite();
private var ldPhoto:Loader;

function SnapShot(strImg:String,strURL:String):void {}

strLink = strURL;
strImage = strImg;

trace ("new snapshot");

spPolaroid.graphics.beginFill (0xCCCCCC);
spPolaroid.graphics.drawRect (0,0,120,140);
addChild (spPolaroid);

var spHolder:Sprite = new Sprite();
spHolder.x = 10;
spHolder.y = 10;
spPolaroid.addChild (spHolder);

loadImage (strImage);

};

private void loadImage(strUrl:String):void {}

ldPhoto = new Loader();
ldPhoto.load (new URLRequest (strUrl));
ldPhoto.contentLoaderInfo.addEventListener (Event.COMPLETE, imageLoaded);

};

private void imageLoaded(evt:Event):void {}

spPolaroid.spHolder.addChild (ldPhoto); This is where the error is to hit

};

};

};

==========================================

I can honestly say that I don't know why the problem exists... and that's probably because I'm not well versed in the field of the class.  But since you have a handle on the spHolder object, you do not need to target through the parent...

private void imageLoaded(evt:Event):void {}
  
spHolder.addChild (ldPhoto);
           
};

Tags: Adobe Animate

Similar Questions

  • Problem with loading external images

    I have a small gallery that I did (Nothing fancy) and want images to load fully before they fade. The process would be, first image load in, click Next, shows preloader bar above the current picture (still on display), and then once fully loaded, replaces the last image with the new it fading... I hope that makes sense...

    Why doesn't this work? I use a loader movie clip...

    Alrighty... I have moved things and I now call to the function loadClip mcl in a different place, so it fades the current image, image, image new charges fades in... Let's see if my customer purchases (they wanted a more seamless transition) with on the pause between showing the loading preloader...

  • How to load external images and animate it after it is loaded?

    I know how to load external images using xml, but the problem is that if I have a lot of images to load then animate after it is loaded. I know theres a work around to this problem but still I have not understand.

    Thanks for help.

    You will need to use the MovieClipLoader class.  It supports have a headset which allows you to determine when the image has loaded so that you can act on it.

    If you are looking for the MovieClipLoader.addEventListener methoid (), there is an example that will be useful to see how to configure things (it's not your scenario, but a good reference).

  • Load external images in symbol or rectangle

    Hello

    Is a way to load external images into a symbol or a rectangle?

    Just google this topic and all the results I found looks like no work aboard animate 2014.1.1

    something like $(this.lookupSelector("target")).attr("src","folder/myimg.jpg");

    Loading jquery im - 2.1.1.min.js

    Thank you.

    Ok. If you have a container div, then it's easy. png or jpg or svg extension

    SYM. $('containerDivName') .css ({'background-image': 'url ("images/imageName.png")', 'background-repeat': 'no-repeat'});

  • Loading external Images causes memory leak

    I worked on an Actionscript 2.0 project that essentially loads external images.
    Whenever I have load and unload a new image, memory increases to 1 or 2 MB
    If all the images are in the cache, then it grew 4 or 8 KBs
    In the unloading of the images, I took the charger and the container of the image.
    Any thoughts why it behaves like this?
    Please find the below sample code snippet.


    ////////////
    btn_load.onRelease = function()
    {
    loadImage();
    }
    btn_unLoad.onRelease = function()
    {
    unLoadImage();
    }
    var mcListener:Object = new Object();
    var container1:MovieClip;
    var mcLoader:MovieClipLoader;
    var loader_reference =;
    var n = 0;
    function loadImage() {}
    var image_arr = ["http://xyz.com/image1.png ',' http://xyz.com/image2.png ',' http://xyz.com/image3.png ',' http: /xyz.com/image4.png http://xyz.com/image5.png ',''"];
    image_url var = image_arr [n];
    {if(n==image_arr.) (Length-1)}
    n = 0;
    } else {}
    n ++ ;
    }

    container1 = loader_reference.createEmptyMovieClip ("Container1", loader_reference.getNextHighestDepth ());
    mcLoader = new MovieClipLoader();
    mcLoader.removeListener (mcListener);
    mcLoader.addListener (mcListener);
    mcListener.onLoadComplete = {function(target_mc:MovieClip,_httpStatus:Number):Void}
    }
    mcListener.onLoadInit = {function(target_mc:MovieClip):Void}
    target_mc._x = 300;
    target_mc._y = 200;
    target_mc._width = 300;
    target_mc._height = 250;
    }
    mcLoader.loadClip (image_url container1);
    }
    function unLoadImage() {}
    mcLoader.unloadClip (container1);
    mcLoader = null;
    container1 = null;
    removeMovieClip (loader_reference.container1);
    }
    ////////////

    Thanks in advance.

    This code should run only once.  fix this.

  • Loading external images

    Can someone tell me if there is a way to load external images into a SWF file. The size of the file becomes large enough, and I'm trying reduced.
    Thank you

    http://www.Kirupa.com/developer/FlashCS3/loading_image_as3_pg2.htm

  • Problem with loading external swf files

    Hello

    I am currently working on a project which is an interactive and dynamic elemtry school presentation to the Denmark. I finished my project and it works perfectly, but only locally on my computer.

    The final draft should be implemented on the site and public work. I tried to implement the project on the site and unfortunately, it does not work as expected.

    When all the files where transferred to the ftp server, only a single files are responding and appear correctly.

    Interactivity of the project is based on a structure of Action script, which is based on the smooth transition between swf files (load another swf file after the action is triggered by clicking on a button) do any work.

    After days of trying to figure out the solution, I'm totally lost. One thing is to publish the project so that all action script will work and answer between swf files, and the other thing is to make it user-friendly for the Android and apple products.

    The presentation is quite heavy because of its loading external swf content files, which are images and movies.

    I really hope you can help me with my problem. I will gladly share the files and codes if it would help solve the problem.

    Best regards

    Agata

    It could be a problem of location of file from loading.  When you place a swf file in an HTML base for targeting anything that the SWF load becomes the folder of the html page.  You may need to adjust the target so that the target of swf files, load it as if it were in the same folder as the html page.

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

    I am a newbie in Flash and spent all day trying to solve this problem and can't solve this no matter what I do.

    I use Action Script 3.0, CS5 on Windows 7.

    I am trying to load two external images (thumbnails) in the magazine "See the picture below for reference", where will be the size of the full image. However, I get this error when testing my movie. What I am doing wrong?

    portfoliobutton.JPG

    Film test error message:

    'port1_btn '.
    TypeError: Error #1010: a term is undefined and has no properties.
    to index_fla::MainTimeline/fl_MouseClickHandler_6().

    'port2_btn '.
    TypeError: Error #1010: a term is undefined and has no properties.
    to index_fla::MainTimeline/fl_MouseClickHandler_7().

    FOR INFO:

    Loader instance name: mainLoader

    Miniature #1 the instance name: port1_btn

    #2 miniature instance name: port2_btn

    This is my code

    portfoliobutton_codeerror.JPG


    Go to your publication of Flash settings and select the option to enable debugging.  Then, the error messages could include an indication of which lines are at the origin of the problem.

    And just for fun to ask because the code is a bit weak... is the mainLoader inside a container named portfolioBkgd?

  • Load external images and video on board

    Hello.

    I'm looking into the edge instead of flash.

    My question is how to load you external images and videos from an external server?

    To clarify, I need to insert a link where the images can be recharged on the stage, while they don t meet the final weight.

    Thanks in advance.

    Best,

    Stig.

    I have provided the above solution works if you have the images in your publication and if you want to form load images from another server rather than the relative location of your html file.

    Now if you want to load images dynamically in a rectagle container you will have to code.

    Here is an example for this

    Create a "rectangle" name "Rectagle.

    Add the code snippet in the composition of the ready or other actions user based on your requirement

    "" var myImagetag = 'http://wwwimages.adobe.com/include/style/default/SiteHeader/logo-2x.png ">"

    SYM.$("rectangle"). Append (myImagetag);

  • AS3 load external image and add multiple instances in Member States

    Hello

    Is it possible to load an external image and add it to more of a clip?

    Thank you

    Chris McLaughlin

    You can load several times, or you can use the bitmapdata class to make copies of the loaded bitmap image.

  • I had the problem in loading multi-image

    var j: Number;
    var wid:Number = 100;
    var imgLoader_show_board:Loader = new Loader();
    for (j = 1; j < 10; j ++) {}
    imgLoader_show_board.load (new URLRequest ("marker_pic/rd_designed_marker_00" + j + ".jpg"));
    imgLoader_show_board.contentLoaderInfo.addEventListener (Event.COMPLETE, onImageLoaded_show_board);

    }
    function onImageLoaded_show_board(evt:Event):void {}
    trace (j);
    addChild (imgLoader_show_board);

    imgLoader_show_board.width = 75;
    imgLoader_show_board.height = 75;
    imgLoader_show_board.x = wid;
    WID += 100;
    }

    I want to load image 9 at the same time

    but there is finally the last image being loaded.

    should ' t use loop for do?

    A loader instance can contain only one piece of content at a time.  Your code is always put in the charger even content.  Try to declare your charger inside the loop and see if that helps.  Your onLoaded function will have to be changed (or moved in the other function as well).

    var j: uint;
    var wid:Number = 100;

    for (j = 1; j<10; j++)="">
    var imgLoader_show_board:Loader = new Loader();
    imgLoader_show_board.load (new URLRequest ("marker_pic/rd_designed_marker_00" + j + ".jpg"));
    imgLoader_show_board.contentLoaderInfo.addEventListener (Event.COMPLETE, onImageLoaded_show_board);
    addChild (imgLoader_show_board);

    imgLoader_show_board.x = wid;
    WID += 100;
    }

    function onImageLoaded_show_board(evt:Event):void {}
    trace (j); This is likely to display the same value... the loop is too fast
    evt. Target.Content.Width = 75;
    evt. Target.Content.Height = 75;
    }

    A for loop will probably end before the first image is loaded, and there is no guarantee that things will be load into any consistent order.  You're probably better off not to use a loop, but rather to create a functional loop, where your end of loading an image starts loading the next image.

  • Problem with loading the images

    Hello.
    I built an application that, among other things, load the images in thumbnails. The people demand changed photos repeatedly. Now they did once again, but despite what they have changed their old images still appear almost anything. I even deleted the cache and the old images still appear.

    Image loading code is exactly this one:
    thumb_mc.loadMovie("poze/thumb1.jpg");

    Unfortunetly I don't have access to the server so I can not check the corectitude of their work. So I ask is it possible to achieve something like this using this code? (there is no image in the .swf file, everything is active when running).

    Thank you.

    They've seen where hidden on the server.

  • Problem with loading of Images from Google

    If I click on one of these photos & choose open in new tab https://fud.community.services.support.microsoft.com/Fud/FileDownloadHandler.ashx?fid=23a96ac6-b84d-4e5a-be5f-ee9132199fac new windows starts loading, but loading never, ends in past it use to open this page full screen if I chose open to the next https://fud.community.services.support.microsoft.com/Fud/FileDownloadHandler.ashx?fid=bab88957-319a-4363-94c3-3249dffdb36atab & firefox starts to consume plenty of use of the disk when loading constantly https://fud.community.services.support.microsoft.com/Fud/FileDownloadHandler.ashx?fid=0da2dd58-2534-4f61-80e7-c5810795a79d whats up with fox? tried this trick with IE, no endless loading, but kind of like Board page, background adds same color as u see on the link (dark), but no picture dark full-page, & IE does not, google changed how it works?, but they have simply not finished remove the fabric & this page left Board & fox is unable to load the blank page? , so I guess his issue not much with images, but did not know how the name of the topic

    all my adds, for additional information

    Edge of Adblock

    Strengthen the encryption

    Ghostery

    More in the content UI +.

    Said John99

    Test in a way similar to my suggestion in your question/questions/1048975 leaks memory
    You use plugins that are designed to block things, and this is probably what is happening, especially with many of these plugins.

    See also

    Also see also

    I must admit that I have not the slightest idea what ms. fud.community.services is

    understand the issue, I have activated encryption apply on google for (I say, cause with adjustable i and different rules on every page) & google does not like to apply encryption, this image is maybe the mac cause fox it different looks, which shows IT enabled http://www.google.ee/imgres?imgurl=https://addons.cdn.mozilla.net/user-media/previews/full/132/132616.png%253Fmodified%253D1396139378 & imgrefurl = https://addons.mozilla.org/en-US/firefox/addon/enforce-encryption/ & h = 504 & w = 681 & tbnid = DT-RdoL0j4fr2M: & zoom = 1 & docid = eCLMIh_3M8GZNM & ei = Ex7zVO-ZDsKcygOP-oLwBQ & tbm = isch & ved = 0CB4QMygBMAE, after that I turned it off, he returned to normal (no problem loading) and no endless loading, I've had HTTPS Everywhere before, I guess HTTPS Everywhere not to force pages which do not support 100%

  • Help please! Problems with loading external swf files

    I'm scared, I'm new to both Adobe Flash and Actionscript 3.0.

    I'm trying to create a simple site using a couple of different external sovereigns loaded into a main swf file.

    For the moment, in the timeline panel, I have the following code in frame 1 of the layer actions:

    import flash.events.MouseEvent;

    Stop();

    navbutt.addEventListener (MouseEvent.CLICK, shownavbg);
    function shownavbg (myEvent:MouseEvent): void {}
    gotoAndPlay (10);
    }
    home_btn.addEventListener (MouseEvent.CLICK, showhome);
    function showhome (myEvent:MouseEvent): void {}
    gotoAndPlay (66);
    }
    aboutme_btn.addEventListener (MouseEvent.CLICK, showaboutme);
    function showaboutme (myEvent:MouseEvent): void {}
    gotoAndPlay (49);
    }
    gallery_btn.addEventListener (MouseEvent.CLICK, showgallery);
    function showgallery (myEvent:MouseEvent): void {}
    gotoAndPlay (76);
    }

    var bgLoader:Loader = new Loader();
    stage.addChild (bgLoader);
    ("var url: URLRequest = new URLRequest("Background/sitebackground/Main.swf ");
    bgLoader.load (url);
    stage.setChildIndex (bgLoader, 0);

    Then, in the framework of 76, I have the following code:

    removeChildAt (0);
    bgLoader.unload ();

    In section 77:

    var galleryLoader:Loader = new Loader();
    stage.addChild (galleryLoader);
    var galleryurl:URLRequest = new URLRequest("test/ZenGalleryDemo.swf");
    galleryLoader.load (url);
    stage.setChildIndex (galleryLoader, 0);

    Stop();

    The idea is that, when the file is loaded, the 'sitebackground/Main.swf"flash loads on the stage. Then I want to delete this flash and load a different one when I click on the gallery_btn. So, when I click on the gallery_btn, he plays frame 76, theoretically unloading the Main.swf and the loading of the ZenGalleryDemo.swf in its place.

    For the moment, the Main.swf loads perfectly and works great. But when I click on the button to the Gallery, he jumps to the frame 76 and plays the Main.swf. It does not load the file ZenGalleryDemo.swf...

    If anyone has any ideas, I would be really grateful!

    Thanks in advance

    It's just a glance and reading, but the problem may lie between these two lines... look closely...

    var galleryurl:URLRequest = new URLRequest("test/ZenGalleryDemo.swf");
    galleryLoader.load (url);

  • XML. Mc load external images not visible mac

    Hello

    I'm going crazy, I just finished a site in flash for a client, I used some basic xml actionscript to dynamically load images, but it does not work on mac (safari/firefox) and sometimes not on a pc with flash 8 installed. I have flash 9 installed on my pc and it works fine.

    This is the url:
    http://www.Gijs.com/Klanten/EZ/

    If you click list (events), you should see images accumulate.

    Could someone throw out me in the face and tell me what that th f * I am doing wrong. He thinks it's the code, but I'm not a really qualified actionscripter.

    If help is really appreciated.
    Thanks in advance

    PROBLEM SOLVED
    I've screwed to the top of the image links check out the adobe tutorial on the paths related and what reading xml file Insert spaces infront of your image url

    http://www.Adobe.com/cfusion/knowledgebase/index.cfm?id=tn_04157
    So after <! [CDATA [directly the url of the image while this works in fr IE Firefox on windows with a space it does not work on Mac.]]

    < image > <! [CDATA [images/mainImage_ '. $project [Id].]] ». jpg]] > < / image >

    Hello

    I'm going crazy, I just finished a site in flash for a client, I used some basic xml actionscript to dynamically load images, but it does not work on mac (safari/firefox) and sometimes not on a pc with flash 8 installed. I have flash 9 installed on my pc and it works fine.

    This is the url:
    http://www.Gijs.com/Klanten/EZ/

    If you click list (events), you should see images accumulate.

    Could someone throw out me in the face and tell me what that th f * I am doing wrong. He thinks it's the code, but I'm not a really qualified actionscripter.

    If help is really appreciated.
    Thanks in advance

    PROBLEM SOLVED
    I've screwed to the top of the image links check out the adobe tutorial on the paths related and what reading xml file Insert spaces infront of your image url

    http://www.Adobe.com/cfusion/knowledgebase/index.cfm?id=tn_04157
    So after

Maybe you are looking for

  • Satellite L510 - need Synaptics driver for Windows 7

    The synaptic Touch Pad Driver has stopped working on my L510. The only driver on the synaptic Web site is for vista os. iIhave w7 and need 13261. Can I use the driver for vista?

  • Can not install HP 4000 with JetDirect on Windows 8.1 card

    Hi guys (and girls) I hope someone can help. Tried to install a HP4000 with a JetDirect card on my network for hours now. My Windows 8.1 x 64 just does not see the printer on the network. (I had a Dell on the network before without problem. When I pr

  • It cannot install any program.

    When I try to install a program I get a vague as error "fatal error during installation (1603)" and when I jump in the log files I read "Key not valid for use in specified state.". Someone recommended I reinstall .NET, but after I took it, I was unab

  • Administrator cannot access folders in Windows 7

    I have a new computer and I am the administrator. I've implemented a new guest account and he was denied access to a folder. However, the administrator can no longer access this folder at all. Even when the administrator account can access the folder

  • BlackBerry Smartphones Bluetooth enable

    I can't get my bluetooth to activate 9630 tour on my phone. It has worked before. He repeats to me it is disabled. Please help me if anyone had ideas about what's not here.