Part 2: Load Image from URL into Dynamic Text Box - goodinson.snapshot

I have a flash file where a user can add an image url into a Dynamic Text Box (image_in.text) and the image will now appear in the flash file.
I am using goodinson.snapshot as featured in this article: Saving Flash graphics as image files at runtime | Adobe Developer Connection
This application works fine (graphic is generated and downloaded) only if a user chooses an included graphic in the flash file (loaded externally) or if I declare a url inside the flash file for the load image variable (var image_url:String = "http://website.com/image.jpg";).
However, if a user enters an image url into the Dynamic Text Box (image_in.text), which the flash does successfully load, the download image function no longer works!
Is this a security bug in flash itself? Or am I missing a code tweak somewhere? 
If an FLA that does this already exists somewhere, let me know.
Thanks in advance for your help!

Thanks for your response!
The image urls are on the same domain as where the swf is.
I don't understand how declaring the variable as the url is different from declaring it from the value of a dynamic text box... it's the same url, but only one method works, shouldn't they both work?
var image_url:String = "http://website.com/image.jpg"; works..
var image_url:String = image_in.text; does not work, even though the value for image_in.text is identical to the one in the example above.
Since they are all on the same domain, this should work, right?
Thanks again.

Similar Messages

  • Cp5 - Pasting text from Notepad into a text box

    I posted this message in the "Getting Started Forum" but there isn't a whole lot of activity in that forum.
    Hopefully someone can help me because I have a lot of text to paste into a lesson.
    This  seems like such an elementary requirement and I am almost certain that I  have done this before but...for some reason, copying text from Windows  Notepad into a Captivate 5 text box just isn't working today.
    Basically, the paste option is simply not available!
    Yes, I can copy paste into other applications; Captivate is the only application that is blocking this Windows function.
    If  I insert a Text Entry Box, I am able to paste single lines of text  (from Notepad) but obviously this isn't going to work as a text box.
    Is this by design or has something gone haywire?
    Question, how do I get pre-written text (i.e. from Notepad) into Captivate?
    Thanks

    Shawn,
    I have had that happen to me too.  I am always copying and pasting into my Captivate projects.  But sometimes the paste option is just not available.  What I have done, is to save everything and close the application and start it again.  Seems there's a lot of little irritating things like that with Captivate, that's corrected with a restart.  Hope this helps!
    Linda
    >>>
    From: shawninvancouver <[email protected]>
    To:Linda Highlander <[email protected]>
    Date: 8/3/2011 10:44 AM
    Subject: Cp5 - Pasting text from Notepad into a text box
    I posted this message in the "Getting Started Forum" but there isn't a whole lot of activity in that forum.
    Hopefully someone can help me because I have a lot of text to paste into a lesson.
    This  seems like such an elementary requirement and I am almost certain that I  have done this before but...for some reason, copying text from Windows  Notepad into a Captivate 5 text box just isn't working today.
    Basically, the paste option is simply not available!
    Yes, I can copy paste into other applications; Captivate is the only application that is blocking this Windows function.
    If  I insert a Text Entry Box, I am able to paste single lines of text  (from Notepad) but obviously this isn't going to work as a text box.
    Is this by design or has something gone haywire?
    Question, how do I get pre-written text (i.e. from Notepad) into Captivate?
    Thanks

  • Problems sending text from JavaScript to dynamic text box

    For reasons which I won't bore you with, I'm trying to send
    text from a JavaScript to a dynamic text box in Flash. I've just
    spent all day wondering why I can't get it to work, despite
    following web guides to the letter. Finally I discovered that I'm
    not actually doing anything wrong and everything works perfectly -
    as long as it's online. It won't work at all locally or from the
    network.
    The problem is that this is for learning material which will
    be deployed both online and on CD, so it won't always be running
    from a webserver. Has anybody got any ideas a) why this is
    happening, and b) what I can do about it?
    Cheers
    Marc

    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPBeans.html
    This is a good tutorial on using JSP pages with JavaBeans.
    Your JSP page can have all the standard HTML tags and a bean can be set to retrieve any values from form fields upon a submit.
    At that point your bean properties are set and your Java application can use that data for whatever processes you wish.
    It's really quite simple once you get the hang of it! ^_^
    Message was edited by:
    maple_shaft

  • How load text into dynamic text boxes from external file?

    hi all,
    my animation is very simple - a background image and 2 text boxes.  one of the textboxes shows a large word, which crossfades to another word, with a total of about 12 words (showing one at a time in different text boxes fading in & out in the same spot).
    i need a way to have the text be imported dynamically via xml or json (xml preferred).  this article is a good start, but i noticed he's putting all of the text into one box - i need separate strings put into separate boxes from the xml.
    Chris Gannon - Loading XML via AJAX into Adobe Edge
    he uses
    var outputField = $(this.lookupSelector(“xmlOutput”));
    for his text box.  what would be the best way to revise this code to include all my individual strings to be loaded into my individual text boxes?  thinking an array might work, but my js skills are limited.
    any other suggestions or tutorials you could point me to would be appreciated.
    thanks!!

    thanks joel_pau !
    this is helpful in seeing how the array is created, but after giving it a go I became a little confused.
    i wound up trying it again based on the example i linked out to previously, but it's not adding the text from my xml file when previewing.
    here's the code i'm using in edge animate on my stage.  something must be wrong somewhere.  let me know if you have any suggestions on this.
    // insert code to be run when the composition is fully loaded here
    // here i'm assigning a variable to each one of my textboxes at they're named in my edge animate comp
    var outputField1 = $(this.lookupSelector("helps2"));
    var outputField2 = $(this.lookupSelector("communicate"));
    var outputField3 = $(this.lookupSelector("experience"));
    var outputField4 = $(this.lookupSelector("interact"));
    var outputField5 = $(this.lookupSelector("understand"));
    var outputField6 = $(this.lookupSelector("overcome"));
    var outputField7 = $(this.lookupSelector("flourish"));
    var outputField8 = $(this.lookupSelector("collab"));
    var outputField9 = $(this.lookupSelector("trust"));
    var outputField10 = $(this.lookupSelector("grow"));
    var outputField11 = $(this.lookupSelector("engage"));
    var outputField12 = $(this.lookupSelector("survive"));
    var outputField13 = $(this.lookupSelector("thrive"));
    var outputField14 = $(this.lookupSelector("evolve"));
    var outputField15 = $(this.lookupSelector("connect"));
    var outputField16 = $(this.lookupSelector("achieve"));
    $.ajax({   
        type: "GET",
        url: "myxmlfile.xml",
        dataType: "xml",
        success: function(xml) {
    //here i'm trying to load the the text in my xml file into my textboxes in edge animate.  'txt1, txt2, txt3' are the tags in my xml file
            outputField1 = $(xml).find('txt1').text();
            outputField2 = $(xml).find('txt2').text();
            outputField3 = $(xml).find('txt3').text();
            outputField4 = $(xml).find('txt4').text();
            outputField5 = $(xml).find('txt5').text();
            outputField6 = $(xml).find('txt6').text();
            outputField7 = $(xml).find('txt7').text();
            outputField8 = $(xml).find('txt8').text();
            outputField9 = $(xml).find('txt9').text();
            outputField10 = $(xml).find('txt10').text();
            outputField11 = $(xml).find('txt11').text();
            outputField12 = $(xml).find('txt12').text();
            outputField13 = $(xml).find('txt13').text();
            outputField14 = $(xml).find('txt14').text();
            outputField15 = $(xml).find('txt15').text();
            outputField16 = $(xml).find('txt16').text();
    but nothing happens on preview.  my textboxes still contain the original text that lives in my comp.

  • Actionscript to load captions from array to dynamic text when thumb is clicked

    i have this code below that i made using a tutorial....it loads vars from txt file splits it then puts it into an array....once in an array it the brings the pics in from the array to create thumbnails and a larger image. my problem is i have captions to go with it and when i try to load the captions nothing happens or can be seen to be happening.
    i dont know where i am going wrong as i have no output or compiled errors
    var locVar = new Array();
    locVar = imgLoc.split(",");
    trace ( locVar );
    var tmbVar = new Array();
    tmbVar = tmbLoc.split(",");
    trace ( tmbVar );
    var capVar = new Array();
    capVar = imgCap.split(",");
    trace ( capVar );
    var NPICS:Number = locVar.length;     // number of pictures to load
    var PICX:Number = 32.8;               // x loc of big picture
    var PICY:Number = 24.9;               // y loc
    var THUMBHOLDERX:Number = 50;        // x location of thumbnail holder movieclip
    var THUMBHOLDERY:Number = 457;      // y location
    var THUMBW:Number = 100;             // width of each thumbnail
    var THUMBH:Number = 75;             // height
    var MARGIN:Number = 10;             // margin between thumbnails
    var TOTALBYTES:Number = 212000;     // approx sum of bytes in all jpgs (x 2)
    var MAXPIXELS:Number = 12;          // max number of pixels to move slider per frame
    // mask definition; mask is assumed to cover some part of the thumbnail slider (here the numbers
    // were chosen so that there are margins between the mask and the right and left edges of the movie
    // (which is 420 x 290), and enough space above and below the thumbs to show them when they 'grow'
    // on mouseover
    var MASKX:Number = 0;                    // start x location of mask
    var MASKW:Number = 600;                    // mask width
    var MASKY:Number = 447.9;                    // start y location of mask
    var MASKH:Number = 92;                    // mask height
    var totalloaded:Number = 0;         // running tally of bytes loaded from all pics
    // index into pictures array, used for loading
    var ipic:Number;
    // set up loader, an instance of MovieClipLoader
    var loader:MovieClipLoader = new MovieClipLoader();
    // use the main timeline to listen to and respond to loader's broadcast events
    loader.addListener(this);
    // function to move thumbnail slider ("this" = thumbs_mc)
    function sliderControl() {
       var w:Number = this._width/2;
       var hw:Number = mask_mc._width/2;
       var npixels:Number;
       // only do when mouse over slider mask
       if (_ymouse > mask_mc._y && _ymouse < mask_mc._y + mask_mc._height) {
          // mouse over left half of slider:
          if (_xmouse > mask_mc._x && _xmouse < mask_mc._x + hw) {
             npixels = (hw - _xmouse) / hw * MAXPIXELS;
             this._x += npixels;
             if (this._x >= 0) this._x = this._x - w;
          // mouse over right half of slider:
          } else if (_xmouse > mask_mc._x + hw && _xmouse < mask_mc._x + mask_mc._width) {
             npixels = (_xmouse - hw) / hw * MAXPIXELS;
             this._x -= npixels;
             if (this._x <= -w) this._x = this._x + w;
    // thumbnail click (onrelease) handler
    function openPic() {
       pic_mc.loadMovie(locVar[this.i]);
    function brightON(){
         this._alpha = 300;
    function brightOFF(){
         this._alpha = 30;
    function captionTXT(){
         _root.cap_txt = capVar;
    // assign event handlers (called when all jpgs are loaded)
    function setupHandlers() {
       pct_txt.removeTextField();          // don't need loading indicator any more
       thumbs_mc.onEnterFrame = sliderControl;
       for (var i:Number = 0; i < NPICS*2; i++) {
          thumbs_mc["mc"+i].onRollOver = brightON;
          thumbs_mc["mc"+i].onRollOut = brightOFF;
          thumbs_mc["mc"+i].onMouseDown = captionTXT;
          thumbs_mc["mc"+i].onRelease = openPic;
    // listener function for broadcast 'done' message (for each pic)
    // onLoadInit gets executed when the movieclip has been loaded into _mc AND
    //   its width and height data are available.
    //   (_mc = the movieclip being loaded into)
    // this routine sets the size and position of each thumbnail clip as its jpg
    //   is loaded and starts the next one loading.  When all have been loaded,
    //   a random picture is loaded into pic_mc and setupHandlers is called to
    //   assign handlers to each thumbnail movieclip
    function onLoadInit(_mc:MovieClip) {
       // this gets done when the jpg is completely loaded:
       _mc._width = THUMBW;
       _mc._height = THUMBH;
       _mc._alpha = 30;          // for image clarity
       // give the movieclip a property to remind it who it is
       // (used by openPic to know which big picture to open)
       _mc.i = (ipic >= NPICS ? ipic-NPICS : ipic);
       // add picture size to totalloaded variable
       totalloaded += loader.getProgress(_mc).bytesTotal;
       // now load the next one (if there are more) or set up handlers if done
       ipic++;
       if (ipic == NPICS * 2) {
          // start with a random photo displayed when all thumbs loaded
          pic_mc.loadMovie(locVar[Math.floor(Math.random()*NPICS)]);
          setupHandlers();
       } else if (ipic >= NPICS) {
          // load jpg into duplicate thumbnail (will already be cached)
          loader.loadClip(tmbVar[ipic-NPICS],  thumbs_mc["mc"+ipic]);
       } else {
          // load jpg into thumbnail
          loader.loadClip(tmbVar[ipic],  thumbs_mc["mc"+ipic]);
    // listener function to handle broadcast progress messages
    // make pct_txt show cumulative loading progress
    function onLoadProgress(_mc:MovieClip, loaded:Number) {
       var loadedsofar:Number = totalloaded + loaded;    
       pct_txt.text = Math.floor(loadedsofar / TOTALBYTES * 100) + "%";
    function init() {
       // create holder for pictures
       createEmptyMovieClip("pic_mc", 1);
       pic_mc._x = PICX;
       pic_mc._y = PICY;
       // create (and draw) holder for thumbnails
       createEmptyMovieClip("thumbs_mc", 2);
       thumbs_mc.beginFill(0, 100);     // black
       thumbs_mc.moveTo(0, 0);
          thumbs_mc.lineTo(2 * (MARGIN + THUMBW) * NPICS, 0);
       thumbs_mc.lineTo(2 * (MARGIN + THUMBW) * NPICS, THUMBH);
       thumbs_mc.lineTo(0, THUMBH);
       thumbs_mc.endFill();
       // drawing the thumb holder at 0, 0 and then moving it makes its reg point = upper left
       thumbs_mc._x = THUMBHOLDERX;
       thumbs_mc._y = THUMBHOLDERY;
       // create, draw and enable mask over thumbs (could use different variables to define mask
       // if desired)
       createEmptyMovieClip("mask_mc", 3);
       mask_mc.beginFill(0x0000cc, 100);
       mask_mc.moveTo(0, 0);
       mask_mc.lineTo(MASKW, 0);
       mask_mc.lineTo(MASKW, MASKH);
       mask_mc.lineTo(0, MASKH);
       mask_mc.endFill();
       mask_mc._x = MASKX;
       mask_mc._y = MASKY;
       thumbs_mc.setMask(mask_mc);
       // create loading textfield indicator
       createTextField("pct_txt", 4, 200, 100, 40, 100);
       var tf:TextFormat = new TextFormat();
       tf.align = "center";
       tf.size = 12;
       tf.font = "Verdana";
       tf.color = 0xFFFF00;
       pct_txt.setNewTextFormat(tf);
       // create loading textfield indicator
       createTextField("cap_txt", 0, 400, 200, 40, 100);
       var cf:TextFormat = new TextFormat();
       cf.align = "center";
       cf.size = 12;
       cf.font = "Verdana";
       cf.color = 0xFFFF00;
       cap_txt.setNewTextFormat(cf);
       // make empty movieclips in thumbs_mc for each pic to go into
       // make double the number so the slider can move continuously and show content
       for (var i:Number = 0; i < NPICS * 2; i++) {
          var mc:MovieClip = thumbs_mc.createEmptyMovieClip("mc"+i, i+1);
          mc._x = i*(MARGIN + THUMBW);
          mc._y = 0;
       // set the pointer to the first jpg in the array picnames
       ipic = 0;
       // start loading jpgs (ipic is initialized to 0)
       loader.loadClip(locVar[ipic], thumbs_mc["mc"+ipic]);
    init();
    stop();

    ok here is my code so far.....i've set a movieclip where i want the captions and set the dyn text box above the clip....i've given the movieclip a background n faded so images can still be seen behind.
    im just having a problem with the loop.....each one i tried resulted in the caption staying the same no matter what thumbnail is clicked.
    are there any suggestions as to how this can be done......(please bare in mind im a newbie to actionscript)
    var locVar = new Array();
    locVar = imgLoc.split(",");
    var tmbVar = new Array();
    tmbVar = tmbLoc.split(",");
    var capVar = new Array();
    capVar = imgCap.split(",");
    var NPICS:Number = locVar.length;     // number of pictures to load
    var PICX:Number = 32.8;               // x loc of big picture
    var PICY:Number = 24.9;               // y loc
    var THUMBHOLDERX:Number = 50;        // x location of thumbnail holder movieclip
    var THUMBHOLDERY:Number = 457;      // y location
    var THUMBW:Number = 100;             // width of each thumbnail
    var THUMBH:Number = 75;             // height
    var MARGIN:Number = 10;             // margin between thumbnails
    var TOTALBYTES:Number = 212000;     // approx sum of bytes in all jpgs (x 2)
    var MAXPIXELS:Number = 12;                    // max number of pixels to move slider per frame
    var CAPSW:Number = 525;                    
    var CAPSH:Number = 28;     
    var CAPSX:Number = 38;            //caption text x position
    var CAPSY:Number = 391;            //caption text y position
    // mask definition; mask is assumed to cover some part of the thumbnail slider (here the numbers
    // were chosen so that there are margins between the mask and the right and left edges of the movie
    // (which is 420 x 290), and enough space above and below the thumbs to show them when they 'grow'
    // on mouseover
    var MASKX:Number = 0;                    // start x location of mask
    var MASKW:Number = 600;                    // mask width
    var MASKY:Number = 447.9;                    // start y location of mask
    var MASKH:Number = 92;                    // mask height
    var totalloaded:Number = 0;         // running tally of bytes loaded from all pics
    // index into pictures array, used for loading
    var ipic:Number;
    // set up loader, an instance of MovieClipLoader
    var loader:MovieClipLoader = new MovieClipLoader();
    // use the main timeline to listen to and respond to loader's broadcast events
    loader.addListener(this);
    // function to move thumbnail slider ("this" = thumbs_mc)
    function sliderControl() {
       var w:Number = this._width/2;
       var hw:Number = mask_mc._width/2;
       var npixels:Number;
       // only do when mouse over slider mask
       if (_ymouse > mask_mc._y && _ymouse < mask_mc._y + mask_mc._height) {
          // mouse over left half of slider:
          if (_xmouse > mask_mc._x && _xmouse < mask_mc._x + hw) {
             npixels = (hw - _xmouse) / hw * MAXPIXELS;
             this._x += npixels;
             if (this._x >= 0) this._x = this._x - w;
          // mouse over right half of slider:
          } else if (_xmouse > mask_mc._x + hw && _xmouse < mask_mc._x + mask_mc._width) {
             npixels = (_xmouse - hw) / hw * MAXPIXELS;
             this._x -= npixels;
             if (this._x <= -w) this._x = this._x + w;
    // thumbnail click (onrelease) handler
    function openPic() {
            pic_mc.loadMovie(locVar[this.i]);
    function brightON(){
         this._alpha = 300;
    function brightOFF(){
         this._alpha = 30;
    function captionTXT(){
         cap_txt.text = capVar[this.i];
    // assign event handlers (called when all jpgs are loaded)
    function setupHandlers() {
       pct_txt.removeTextField();          // don't need loading indicator any more
       thumbs_mc.onEnterFrame = sliderControl;
       for (var i:Number = 0; i < NPICS*2; i++) {
          thumbs_mc["mc"+i].onRollOver = brightON;
          thumbs_mc["mc"+i].onRollOut = brightOFF;
          thumbs_mc["mc"+i].onMouseDown = captionTXT;
          thumbs_mc["mc"+i].onRelease = openPic;
    // listener function for broadcast 'done' message (for each pic)
    // onLoadInit gets executed when the movieclip has been loaded into _mc AND
    //   its width and height data are available.
    //   (_mc = the movieclip being loaded into)
    // this routine sets the size and position of each thumbnail clip as its jpg
    //   is loaded and starts the next one loading.  When all have been loaded,
    //   a random picture is loaded into pic_mc and setupHandlers is called to
    //   assign handlers to each thumbnail movieclip
    function onLoadInit(_mc:MovieClip) {
       // this gets done when the jpg is completely loaded:
       _mc._width = THUMBW;
       _mc._height = THUMBH;
       _mc._alpha = 30;          // for image clarity
       // give the movieclip a property to remind it who it is
       // (used by openPic to know which big picture to open)
       _mc.i = (ipic >= NPICS ? ipic-NPICS : ipic);
       // add picture size to totalloaded variable
       totalloaded += loader.getProgress(_mc).bytesTotal;
       // now load the next one (if there are more) or set up handlers if done
       ipic++;
       if (ipic == NPICS * 2) {
          // start with a random photo displayed when all thumbs loaded
           var calc:Number = Math.floor(Math.random()*NPICS);
          pic_mc.loadMovie(locVar[0]);
           cap_txt.text = capVar[0];
          setupHandlers();
       } else if (ipic >= NPICS) {
          // load jpg into duplicate thumbnail (will already be cached)
          loader.loadClip(tmbVar[ipic-NPICS],  thumbs_mc["mc"+ipic]);
       } else {
          // load jpg into thumbnail
          loader.loadClip(tmbVar[ipic],  thumbs_mc["mc"+ipic]);
    // listener function to handle broadcast progress messages
    // make pct_txt show cumulative loading progress
    function onLoadProgress(_mc:MovieClip, loaded:Number) {
       var loadedsofar:Number = totalloaded + loaded;     
       pct_txt.text = Math.floor(loadedsofar / TOTALBYTES * 100) + "%";
    function init() {
       // create holder for pictures
       createEmptyMovieClip("pic_mc", 1);
       pic_mc._x = PICX;
       pic_mc._y = PICY;
       // create (and draw) holder for thumbnails
       createEmptyMovieClip("thumbs_mc", 2);
       thumbs_mc.beginFill(0, 100);     // black
       thumbs_mc.moveTo(0, 0);
       thumbs_mc.lineTo(2 * (MARGIN + THUMBW) * NPICS, 0);
       thumbs_mc.lineTo(2 * (MARGIN + THUMBW) * NPICS, THUMBH);
       thumbs_mc.lineTo(0, THUMBH);
       thumbs_mc.endFill();
       // drawing the thumb holder at 0, 0 and then moving it makes its reg point = upper left
       thumbs_mc._x = THUMBHOLDERX;
       thumbs_mc._y = THUMBHOLDERY;
       // create, draw and enable mask over thumbs (could use different variables to define mask
       // if desired)
       createEmptyMovieClip("mask_mc", 3);
       mask_mc.beginFill(0x0000cc, 100);
       mask_mc.moveTo(0, 0);
       mask_mc.lineTo(MASKW, 0);
       mask_mc.lineTo(MASKW, MASKH);
       mask_mc.lineTo(0, MASKH);
       mask_mc.endFill();
       mask_mc._x = MASKX;
       mask_mc._y = MASKY;
       thumbs_mc.setMask(mask_mc);
       // create loading textfield indicator
       createTextField("pct_txt", 4, 200, 100, 40, 100);
       var tf:TextFormat = new TextFormat();
       tf.align = "center";
       tf.size = 12;
       tf.font = "Verdana";
       tf.color = 0xFFFF00;
       pct_txt.setNewTextFormat(tf);
       createEmptyMovieClip("caps_mc", 5);
       caps_mc.beginFill(0x000000, 50);
       caps_mc.moveTo(0, 0);
       caps_mc.lineTo(CAPSW, 0);
       caps_mc.lineTo(CAPSW, CAPSH);
       caps_mc.lineTo(0, CAPSH);
       caps_mc.endFill();
       caps_mc._x = CAPSX;
       caps_mc._y = CAPSY;
       // create loading textfield indicator
       createTextField("cap_txt", 6, 38, 380, 525, 25);
       var cf:TextFormat = new TextFormat();
       cf.align = "center";
       cf.size = 16;
       cf.font = "Arial Black";
       cf.color = 0xFFFFFF;
       cap_txt.setNewTextFormat(cf);
       cap_txt._x = CAPSX;
       cap_txt._y = CAPSY;
       // make empty movieclips in thumbs_mc for each pic to go into
       // make double the number so the slider can move continuously and show content
       for (var i:Number = 0; i < NPICS * 2; i++) {
          var mc:MovieClip = thumbs_mc.createEmptyMovieClip("mc"+i, i+1);
          mc._x = i*(MARGIN + THUMBW);
          mc._y = 0;
       // set the pointer to the first jpg in the array locVar
       ipic = 0;
       // start loading jpgs (ipic is initialized to 0)
       loader.loadClip(locVar[ipic], thumbs_mc["mc"+ipic]);
       cap_txt.text = capVar[2];
    init();
    stop();

  • Cannot load images from URL, but ok from file?

    Hi people,
    In the followint simple code (I'm eventually placing these into a media tracker), when I'm debugging on my local PC, the images load no problem, but when I deploy to the web they do not. The rest of the application carries on regardless however. I'm wondering if this is a sufficiently generic method of getting media resources. http://www.thermoteknix.com/93266898/VirtualVisIR_Main.htm (its a simulation of one of our new infrared cameras). I cannot get it to load media, unless its from my hard-drive of course!
    Does anyone know what I should do instead?
    URL Url = Parent.getDocumentBase ();
    VisIRBackground     = Parent.getImage ( Base, "images/rear view.jpg" );
    VisIRThermoIcon     = Parent.getImage ( Base, "images/redonion.gif" );
    VisIRIndigoIcon     = Parent.getImage ( Base, "images/indigo.gif" );
              

    Ok, just in case is isn't anything to do with paths, here is my loop to load all of my images (which have been created with getImage (x,y)):
    Is this technically correct? I've added the images to the media tracker with an incrementing ID, so we have 1 ID per item, starting at zero.
    for ( nImagesLoaded = 0; nImagesLoaded < nImagesToLoad; nImagesLoaded++ )
         try {
              VisIRMediaTracker.waitForID ( nImagesLoaded );
              bFailed = VisIRMediaTracker.isErrorID ( nImagesLoaded );
              if ( bFailed )
                   break;
         catch ( InterruptedException e ) {
              System.err.println( e.toString () + new Integer ( nImagesLoaded ).toString () );
    }

  • Load image from URL on file open, then embed image

    I am trying to create a PDF form with an image field that is empty/blank by default. When the PDF is opened, I want it to load the image at C:\picture.jpg and embed that image in that document.
    I need it to load on file open because C:\picture.jpg will be different each time the file is opened. Currently, if I set the image URL and embed it, it uses the image at the first time it's embedded.

    Okay, I created userInfo.js and placed it in C:\Program Files (x86)\Adobe\Acrobat 10.0\Acrobat\Javascripts. That file (adapted from How do I change an image in a button automatically without changing its location?):
    myIcon = app.trustedFunction( function (){app.beginPriv();
    this.getField("userInfo").buttonImportIcon("C:\\picture.jpg")
    app.endPriv();})
    I then added event.target.myIcon(event.target) to topmostSubform.Page1::initialize.
    I get the following error when opening my pdf:
    TypeError: this.getField("userInfo") is null
    2:XFA:topmostSubform[0]:Page1[0]:initialize
    I know the field is null. I want it to be null until I open the pdf. Is there another reason that error would be appearing?

  • Dynamic Image (.gif) from URL into adobe Form by SFP

    Hi all
    I post the comment of Shamila because I have the same problem
    I need to place an image in the Adobe form based on the url.
    I have written the following formcalc script in the image field form ready action
    ImageField1.value.image.href = "http://www.adobe.com/imageshome/pdfgift_home.gif"
    But when i view the form , the image field is empty, and when i click on the blank space of the image field, a popup appears to select the image............
    How can i show the image from url in the form..........
    Regards,

    Hello,
    have you checked these basics documents?
    When you need to send a picture into the offline form: another image question - using Regular ABAP not web dynpro and Display a logo dynamically in adobe form
    Where to start with scripting: http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_basics.pdf
    http://help.adobe.com/en_US/livecycle/es/FormCalc.pdf
    Also try: Re: Dynamic R/3 Image URL in Adoeb Form
    regards, Otto

  • Issues with Loading Images from a Jar File

    This code snippet basically loops through a jar of gifs and loads them into a hashmap to be used later. The images all load into the HashMap just fine, I tested and made sure their widths and heights were changing as well as the buffer size from gif to gif. The problem comes in when some of the images are loaded to be painted they are incomplete it looks as though part of the image came through but not all of it, while other images look just fine. The old way in which we loaded the graphics didn't involve getting them from a jar file. My question is, is this a common problem with loading images from a jar from an applet? For a while I had tried to approach the problem by getting the URL of the image in a jar and passing that into the toolkit and creating the image that way, I was unsuccessful in getting that to work.
    //app is the Japplet
    MediaTracker tracker = new MediaTracker(app);
    //jf represents the jar file obj, enum for looping through jar entries
    Enumeration e = jf.entries();
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    //buffer for reading image stream
    byte buffer [];
    while(e.hasMoreElements())
    fileName = e.nextElement().toString();
    InputStream inputstream = jf.getInputStream(jf.getEntry(fileName));
    buffer = new byte[inputstream.available()];
    inputstream.read(buffer);
    currentIm = toolkit.createImage(buffer);
    tracker.addImage(currentIm, 0);
    tracker.waitForAll();
    images.put(fileName.substring(0, fileName.indexOf(".")), currentIm);
    } //while
    }//try
    catch(Exception e)
    e.printStackTrace();
    }

    compressed files are not the problem. It is just the problem of the read not returning all the bytes. Here is a working implementation:
    InputStream is = jar.getInputStream(entry);
    ByteArrayOutputStream os = new ByteArrayOutputStream(1024);
    try{
    byte[] buf = new byte[1024];
    int read;
    while((read = is.read(buf)) > 0) {
    os.write(buf, 0, read);
    catch(Exception e){
         e.printStackTrace();
         return null;
    image = Toolkit.getDefaultToolkit().createImage(os.toByteArray());
    This works but I think you end up opening the jar a second time and downloading it from the server again. Another way of getting the images is using the class loader:
    InputStream is = MyApplet.class.getResourceAsStream(strImageName);
    In this case, the image file needs to be at the same level than MyApplet.class but you don't get the benefit of enumerating of the images available in the jar.

  • Loader will load images from another server, but then we get error on Bitmap operation

    I'm developing an app that currently is using Loader to get images from another server.  This shouldn't currently work since we are still waiting for the owner of that server to put a crossdomain file in place.  However, it does work -- sort of .
    Loader can load the images fine, without an error.  But then the app has a feature in which we are making a larger duplicate of the image to display in a sidebar, we do this in this manner:
    var myBitmap:Bitmap = Bitmap(loader.content);
    and when this runs we get a Flash player security error 2122, sandbox violation.
    So while I'm hoping all this will fix itself when the crossdomain.xml file is put in place, I'm confused as to why we only get the sandbox error when we make a Bitmap from the image, and not when we initially try to retrieve the image.
    (Incidentally: is there a better way to make a "copy" of an image loaded by a Loader, and then change its width and height for simultaneous display in another part of the stage?  I don't need to change its actual dimensions -- I just need to change its display width and height.)
    Thanks!

    The sandbox allows viewing, not editing from another server without a crossdomain.
    So, when you try to load it up, it loads it, but "read-only" and gives you an error when you try to "edit" it by making a new Bitmap out of it.
    This should resolve itself once that crossdomain is in place.
    ||EDIT||
    I just realized I should clarify my statement a little more.
    When you load images from another server without a crossdomain, it allows the load for display only.  When you try to load data, it will fail.  This is because, XML data, or some other type of data is editable by default, and images are only viewable by default.  So, the image fails when you try to convert it into an editable form.

  • Adobe Flex unable to load images from Amazon S3

    I have a flex 3 app that is attempting to load images from Amazon S3. The images fail to load, so I fired up debug mode. In debug mode, the images load, but I also get the following output in the debugger:
        *** Security Sandbox Violation ***
        SecurityDomain 'http://mybucket.s3.amazonaws.com/logos/mylogo.png' tried to access incompatible context 'http://localhost/myapp/bin-debug/index.html?debug=true'
    I have added a crossdomain.xml file into the root of my bucket as follows, but this does not seem to help:
        <?xml version="1.0" encoding="utf-8" ?>
        <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
        <cross-domain-policy>
          <site-control permitted-cross-domain-policies="master-only" />
          <allow-access-from domain="*" />
          <allow-http-request-headers-from domain="*" />
        </cross-domain-policy>
    I then tried the following:
    Security.loadPolicyFile('http://mybucket.s3.amazonaws.com/crossdomain.xml');
    Security.allowInsecureDomain('http://mybucket.s3.amazonaws.com/');
    Security.allowDomain('http://mybucket.s3.amazonaws.com/');
    At this point, it seems that there are not any more errors reported in debug mode. However, when not in debug mode, then the image still does not load.
    Am I missing something obvious here?

    If you are not getting creationComplete in release vs debug builds, it is best to try to identify the differences between the two runtime environments.
    Is the URL to the SWF the same?  Some folks find that their release folder is missing some important file.
    Is the URL to the HTML wrapper the same?  Some folks launch their debug from file:// and their release from http:// which have different security rules
    Is the launch step the same?  Some folks launch their debug from FlashBuilder and their export via some other mechanism.  This can alter the initial size of the app and that difference can cause some apps to get into a “layout loop” and never hit creationComplete.  To find out if you are in such a loop, report calls to updateDisplayList, and measure() on various compoonents and see if they keep getting called.
    Is there a timing difference?  Some apps may have subtle timing dependencies that change when the release build runs faster.

  • Loading image from jars only once in oracle forms 10g

    Hi,
    I have an oracle forms 10g application which loads image from a jar. Every time i click on a button "A" that loads the image "image" on another button "B" in the same screen, a message is displayed in the java console "Loaded image: jar:https://+IP+/forms/java/+myjar+.jar!/image.gif". So after 10 clicks, i get the same message displayed 10 times. In the form, i've called:
    SET_CUSTOM_PROPERTY(p_object_name, 1, 'IMAGE_NAME_ON', '/'||p_image_name);My question is the following:
    - is there a way to load this image once and use it later without having to load it every time i clik on "A"? if yes, how?
    P.S.: if this thread shouldn't be posted in this forum, please redirect me to the right one.
    Thanks in advance

    Ah okay.
    I'm using the rolloverbutton.jar (RollOver Button PJC) [RolloverButton.java -> authors: Steve Button, Duncan Mills].
    Here is the part concerning the IMAGE_NAME_ON function:
    // make sure we are in rollover mode
    enableRollover();
    log("setProperty - IMAGE_NAME_ON value=" + value.toString());
    // load the requested image
    m_imageNameOn = (String) value;
    loadImage(ON,m_imageNameOn);
    // reset the currrently drawn image if needed
    setImage(ON,m_state);
    return true;where loadImage function is:
        URL imageURL = null;
        boolean loadSuccess = false;
        //JAR
        log("Searching JAR for " + imageName);
        imageURL = getClass().getResource(imageName);
        if (imageURL != null)
          log("URL: " + imageURL.toString());
          try
            m_images[which] = Toolkit.getDefaultToolkit().getImage(imageURL);
            loadSuccess = true;
            log("Image found: " + imageURL.toString());
          catch (Exception ilex)
            log("Error loading image from JAR: " + ilex.toString());
        else
          log("Unable to find " + imageName + " in JAR");
        //DOCBASE
        if (loadSuccess == false)
          log("Searching docbase for " + imageName);
          try
            if (imageName.toLowerCase().startsWith("http://")||imageName.toLowerCase().startsWith("https://"))
              imageURL = new URL(imageName);
            else
              imageURL = new URL(m_codeBase.getProtocol() + "://" + m_codeBase.getHost() + ":" + m_codeBase.getPort() + imageName);
            log("Constructed URL: " + imageURL.toString());
            try
              m_images[which] = createImage((java.awt.image.ImageProducer) imageURL.getContent());
              loadSuccess = true;
              log("Image found: " + imageURL.toString());
            catch (Exception ilex)
              log("Error reading image - " + ilex.toString());
          catch (java.net.MalformedURLException urlex)
            log("Error creating URL - " + urlex.toString());
        //CODEBASE
        if (loadSuccess == false)
          log("Searching codebase for " + imageName);
          try
            imageURL = new URL(m_codeBase, imageName);
            log("Constructed URL: " + imageURL.toString());
            try
              m_images[which] = createImage((java.awt.image.ImageProducer) imageURL.getContent());
              loadSuccess = true;
              log("Image found: " + imageURL.toString());
            catch (Exception ilex)
                    log("Error reading image - " + ilex.toString());
          catch (java.net.MalformedURLException urlex)
            log("Error creating URL - " + urlex.toString());
        if (loadSuccess == false)
          log("Error image " + imageName + " could not be located");In this case, what shall i modify?
    Thanks in advance

  • Download Images from URL

    I want to save images to memory 50 images
    My software processing ----
    1. Download Image from URL every 60 secs and all downloaded images have time to use 15 mins
    2. When download image done save images to memory
    3. Then show images in picturebox
    4. When user click button get next image form memory and delete old image from memory
    5. If what images not use in 15 mins auto delete from memory
    Help me ... Thank you a lot 

    Ok chechk the below method/Events that will download 50 image and fill a List<image> object into memory, you need to add a picturebox1 and button1 to your form, I used my profile pic here on msdn the link you've send didn't work:
    //Global Variables
    List<Image> li = new List<Image>();
    int second = 0; //Form Initaile
    public Captcha()
    InitializeComponent();
    //Async download event
    private void ReadCallback(IAsyncResult asynchronousResult)
    HttpWebRequest request = (HttpWebRequest)asynchronousResult.AsyncState;
    HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asynchronousResult);
    using (StreamReader streamReader1 = new StreamReader(response.GetResponseStream()))
    li.Add(Image.FromStream(streamReader1.BaseStream));
    pictureBox1.Image = li[0];
    //Download Method for 50 images
    private void DownLoadImages()
    try
    for (int i = 0; i <= 50; i++)
    HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(new Uri("https://i1.social.s-msft.com/profile/u/avatar.jpg?displayname=fouad%20roumieh&size=extralarge&version=00000000-0000-0000-0000-000000000000"));
    request.BeginGetResponse(new AsyncCallback(ReadCallback), request);
    catch (WebException ex)
    //Form Load
    private void Captcha_Load(object sender, EventArgs e)
    DownLoadImages();
    And here on button click event we remove element and show the next one into picture box, and if used up all image we call the async download messages again to get a new list of images:
    private void button1_Click(object sender, EventArgs e)
    li.RemoveAt(0);
    if (li.Count > 0)
    { //Show next
    pictureBox1.Image = li[0];
    else
    DownLoadImages();
    Also here a timer event I didn't enable but you can enable to check for the 15 mins and destroy the images list if passed:
    private void timer1_Tick(object sender, EventArgs e)
    second = second + 1;
    int minutes = second / 60;
    if (minutes >= 15)
    li.Clear();
    //Call downloadimages or else...
    Fouad Roumieh

  • How do i load images from a folder?

    Hello everyone,
    Please can someone help me as i am stuck.
    I am trying to research loading images from a folder called /images/unknown (unknown is a customer number and is stored in a variable called customerNo).
    I feel that i will need to load the images into an array then display them to the screen with a viewer.
    Can anybody help me.
    Thanks in advance

    Welcome to the Sun forums.
    irknappers wrote:
    ...Please can someone help me as i am stuck.You might want to be more exact in future, about what you are stuck on.
    import javax.imageio.ImageIO;
    import java.io.FileFilter;
    import java.io.File;
    import javax.swing.JFileChooser;
    class LoadImages {
        public static void main(String[] args) {
            String[] suffixes = ImageIO.getReaderFileSuffixes();
            FileFilter fileFilter = new FileFilterType(suffixes);
            File directory = null;
            if (args.length==1) {
                directory = new File( args[0] );
            } else {
                JFileChooser fileChooser = new JFileChooser();
                fileChooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY );
                int result = fileChooser.showOpenDialog( null );
                if ( result == JFileChooser.APPROVE_OPTION ) {
                    directory = fileChooser.getSelectedFile();
                } else {
                    System.err.println("Must select a directory to proceed, exiting.");
            File[] images = directory.listFiles( fileFilter );
            for (File file : images) {
                System.out.println(file);
            System.out.println( "The rest is left an exercise for the reader.  ;-)" );
    class FileFilterType implements FileFilter {
        String[] types;
        FileFilterType(String[] types) {
            this.types = types;
        public boolean accept(File file) {
            for (String type : types) {
                if ( file.getName().toLowerCase().endsWith( type.toLowerCase() ) ) {
                    return true;
            return false;
    }

  • How can I load a .TXT file into a dynamic text box?

    I am sure that many people know how to load a .txt file into
    a dynamic text box. But I do not. I want to be able to reference a
    txt file from the server into the text box. So that when I change
    the text file it changes in the flash movie without even editing
    the flash file itself. Thank you.

    http://www.oman3d.com/tutorials/flash/loading_external_text_bc/
    I think this is the simplest way to go :)

Maybe you are looking for

  • 10.9.2 Mail not working correctly

    I'm the only person in the office to upgrade to 10.9.2 (thankfully!). Since then, Mail has not worked correctly. It is an IMAP account. When I click on an existing message in my inbox, instead of displaying instantly it takes 3-4 seconds. The screen

  • How to reenable mms access in a mini droid?

    How to re-enable mmsdata access in a mini droid?

  • -xopenmp option on Solaris on Intel?????

    Hi, I installed the latest c compiler on Solaris Intel. I thought OpenM was available there but it is not. Is there something wrong? Erling PS. A proof. cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15 usage: cc [ options] files. Use 'cc -flags' for deta

  • Print to scale?????

    Forgive me if I'm not posting this correctly. I see where 2 others have the same problem that I'm experiencing and the only options I saw in the thread was a "reply to" and nowhere to "add to" so here I am. I cannot print to the size that on the scre

  • Sony Digital 8 Handycam USB only + Final Cut = No go?

    Hi, a while back my parents bought a Sony Digital 8 Handycam, the digital 8 format is identicle to miniDV. The problem is, FCP doesn't seem to accept USB? This camera only transfers via USB, and I was able to on my PC running Vegas, is this not possi