Image display: instead of an image, there is a "picture placeholder" icon

Hello everyone!
I'm afraid I need some assistance. As I've already indicated in a thread title, I have problems while trying to display an image stored within the database. I read zillion threads here on OTN, searched the Internet, but I can't make it work. More or less, it comes to what Denes Kubicek provided [url http://htmldb.oracle.com/pls/otn/f?p=31517:64:850093673123067]here
Tools I use are Oracle 10g XE database (10.2.0.1.0) and Application Express (3.2.1.00.10).
There's a table that contains information about certain products (such as printer toners, cartridges, CD media etc.). This is its description:
SQL> desc pm_materijal
Name                          Null?    Type
ID                            NOT NULL NUMBER
IDG                                    NUMBER
SIFRA                                  VARCHAR2(30)
SIFRA_KRATKA                           VARCHAR2(30)
MODEL                                  VARCHAR2(30)
NAZIV                                  VARCHAR2(255)
NAPOMENA                               VARCHAR2(255)
FILE_NAME                              VARCHAR2(200)
MIME_TYPE                              VARCHAR2(255)
BLOB_CONTENT                           BLOBOne of its records looks like this (other column values are unimportant) (columns are formatted so that they fit a single line):
SQL> select id, naziv, file_name, dbms_lob.getlength(blob_content) len
  2  from pm_materijal
  3  where id = 64;
        ID NAZIV                FILE_NAME                                    LEN
        64 CD recordable 1/50 Now I'd like to attach an image to those CDs.
In my Apex application, I created an item (on a page 7) whose name is P7_BROWSE (Display as "File Browse") - it is used to browse directories for files (images, actually). In order to support table record updating, I created a Process (Process point: On submit - after computations and validations).
if :p7_browse is not null then
   update pm_materijal set
     (mime_type, file_name, blob_content) =
     (select
        mime_type, name, blob_content
        from wwv_flow_files
        where name = :p7_browse
     where id = :p7_id;
   delete from wwv_flow_files
     where name = :p7_browse;
end if;It seems that it works OK, because - once I select an image (it is a JPG file, its size is 116 x 116) and push the "Apply Changes" button - the result is as following:
SQL> select id, naziv, file_name, dbms_lob.getlength(blob_content) len
  2  from pm_materijal
  3  where id = 64;
        ID NAZIV                FILE_NAME                                    LEN
        64 CD recordable 1/50   F477411270/cd_50_komada.jpg                 2111           My next step was to create a stored procedure which will be used to display images:
SQL> create or replace procedure image_display (p_id in number)
  2  as
  3    l_mime        varchar2 (255);
  4    l_length      number;
  5    l_file_name   varchar2 (200);
  6    l_blob        blob;
  7  begin
  8    select mime_type,
  9           blob_content,
10           file_name,
11           dbms_lob.getlength (blob_content)
12      into l_mime,
13           l_blob,
14           l_file_name,
15           l_length
16      from pm_materijal
17      where id = p_id;
18
19     owa_util.mime_header (nvl (l_mime, 'application/octet'), false);
20     htp.p ('Content-length: ' || l_length);
21     owa_util.http_header_close;
22     wpg_docload.download_file (l_blob);
23  end image_display;
24  /
Procedure created.As suggested in a few OTN threads, I did this too (although I don't quite understand WHY, as I created the procedure in a schema I use in Apex; there are no other users involved). Anyway: I thought that it won't do any harm (but it didn't do any good either).
SQL> grant execute on image_display to public;
Grant succeeded.
SQL> create public synonym image_display for radni.image_display;
Synonym created.Back to Application Express: I created a Reports Region (Type: SQL Query). Its source is :
select
  id,
  file_name,
  mime_type,
  dbms_lob.getlength(blob_content) len,
  '<img src="#OWNER#.image_display?p_id='
         || NVL (ID, 0)
         || '" height="'
         || 120
         || '" width="'
         || 120
         || '" />' image
from pm_materijal
where id = :P7_IDFinally, run the page! Reports region contains a single record which displays information I selected in SQL*Plus (so it seems that query DOES return something, and - I'd say that it is correct), but - instead of an image - there's an "invalid (broken) image" icon (you know, a small white rectangle with a red <font color="red">x</font>).
I can't figure out what I did wrong. It should work, but it doesn't. Could someone, please, point me to the right direction?
Regards,
LF

Patrick said: specify your schema name instead of the #OWNER# placeholder
I said: while I was trying to make it work, I used "schema_owner.procedure_name" notation too but that didn't help eitherOracle user name is "RADNI" (the one I used to create objects, I was connected to it in SQL*Plus - all my previous copy/pastes were taken while connected to that user).
So I tried with
- <img src="radni.image_display?p_id=...   => didn't work
- <img src="RADNI.image_display?p_id=...   => didn't work
- <img src="image_display?p_id=...         => worked
{code}
I just started using Application Express so, basically, every day I discover something new. I purchased a book (based on Apex 3.2) so I thought that I'd rather stick to it until I +get a feeling+ and then, hopefully, move on to a higher version.
By the way, looking forward to see you on HrOUG in two weeks!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Can I make an image display instead of flash slideshow on explorer with high security?

    I am a total flash beginner.  I created a simple flash slideshow that I want to appear on my website.  It works fine in firefox., but when viewed in explorer with high security, nothing displays unless the viewer specifically allows it. The slideshow is very prominent, and the site looks very bad when only an x shows up.   Is it possible to have a static image display in place of the slideshow, and then have the slideshow start if the viewer allows it? Is there any other way to get around this? 
    Thank you for any assistance.
    EJ

    Have you tested it with IE online or only locally?  Locally IE will usually prohibit displaying Flash content.

  • Loading image name instead of the image

    Hi all,
    Sorry but i'm a little new to AS3 and flash and have come to an abrupt halt.  I have a database (phpMyAdmin 2.6.0-beta2 ) which holds information which i want to display in a flash form so i'm using an XML file to bridge the gap.  After building the application in FLASH and running it the text from the database comes through but no the images.   Details of what i'm trying to do are as follows:
    The XML file
    <?php echo "<?xml version='1.0' encoding='ISO-8859-1'?>"?>
    <catalogue>
    <?php do { ?>
    <fish>
      <Id><?php echo $row_all_fish['ID']; ?></Id>
         <Name><?php echo $row_all_fish['Name']; ?></Name>
            <Description><?php echo $row_all_fish['Description']; ?></Description>
            <Price><?php echo $row_all_fish['Price']; ?></Price>
            <Image><?php echo $row_all_fish['Image']; ?></Image> 
    </fish>
    <?php } while ($row_all_fish = mysql_fetch_assoc($all_fish)); ?>   
    </catalogue>
    <?php
    mysql_free_result($all_fish);
    ?>
    The action script part from FLASH
    xmlObject = new XML();
    xmlObject.onLoad = readMedia;
    xmlObject.ignoreWhite = true;
    // **************vvvvvvvvvvvvvvvvEdit this bitvvvvvvvvvvvv*********************************
    xmlObject.load("http://localhost/fishing/generate_xml.php");
    // ***************^^^^^^^^^^^^^^^Edit this bit^^^^^^^^^^^^*********************************************
    stop();
    function readMedia(success) {
    if (success == true) {
      // Root node
      rootNode = xmlObject.firstChild;
      // id = number of child nodes
      sizeOfCollection = rootNode.childNodes.length;
      // Current node = first child node
      currentNode = rootNode.firstChild;
      // Display next car.
      drawItem();
    function drawItem() {
    // **************vvvvvvvvvvvvvvvvEdit this bitvvvvvvvvvvvv*********************************
    Id.text = currentNode.childNodes[0].firstChild;
    Name.text = currentNode.childNodes[1].firstChild;
    Description.text = currentNode.childNodes[2].firstChild;
    Price.text = currentNode.childNodes[3].firstChild;
    Image.text = currentNode.childNodes[4].firstChild;
    // ***************^^^^^^^^^^^^^^^Edit this bit^^^^^^^^^^^^*********************************************
    debug();
    nextFish.onRelease = function() {
    nextNode = currentNode.nextSibling;
    if (nextNode == null) {
      break;
    } else {
      currentNode = nextNode;
      drawItem();
    previousFish.onRelease = function() {
    nextNode = currentNode.previousSibling;
    if (nextNode == null) {
      break;
    } else {
      currentNode = nextNode;
      drawItem();
    // Read Greens XML file.
    Greens.onRelease = function() {
    // **************vvvvvvvvvvvvvvvvEdit this bitvvvvvvvvvvvv*********************************
    xmlFile = "http://localhost/fishing/generate_xml.php";
    // ***************^^^^^^^^^^^^^^^Edit this bit^^^^^^^^^^^^*********************************************
    xmlObject.load(xmlFile);
    function debug() {
    // **************vvvvvvvvvvvvvvvvEdit this bitvvvvvvvvvvvv*********************************
    Id = currentNode.childNodes[0].firstChild;
    Name = currentNode.childNodes[1].firstChild;
    Description = currentNode.childNodes[2].firstChild;
    Price = currentNode.childNodes[3].firstChild;
    Image = currentNode.childNodes[4].firstChild;
    // ***************^^^^^^^^^^^^^^^Edit this bit^^^^^^^^^^^^*********************************************
    stop();
    I can not workout how to display the image itself instead of the files name.  Any help anyone can give would be great!
    Thanks for your time helping me.

    that's actionscript 2.
    and, is there an image url in there somewhere?

  • How to "Save Image" directly instead of "Save Image As"?

    Is there anyway or option to directly save images instead of having to click "save image as" then go into the popup to save the image location? Thank you!

    Gingerbread Man made good suggestions.
    However you still must "save as" something even if "unnamed001". Windows requires a name and location for each file (whether an image or other file) saved. You can have the same file name in different directories (folders).
    You can copy and paste images without saving, in some applications.

  • Image Attachment instead of embedded image (for sending photos)

    Hi,
    Is there a way to make mail send photos as an attachment rather than as an embedded image in the email? My colleagues are using Lotus Notes at work. Everytime I send them photos, they complain to me that they are having a hard time downloading the pictures 'coz they cannot simply click on it and save.
    thanks,
    zurc

    zurc,
    I sent mail in text-only format and put attachments at the very end of the message. I think photos and images are shown inline when send in a message in formatted-text format.
    Putting the files at the very end of the message prevents the mail being "split up" in several parts (body, photo attachment, and signature as attachment) which is also annoying for Windows users.
    I have to admit that I don't know if this works with Lotus Notes, but you could give it a try.

  • LabVIEW 8.2 Image Display bug

    Hi all,
    Description : Trying to create a constant by right
    clicking on an image display (controls palette > vision > image
    display) causes labview to crash.
    LV
    version : 8.20 only, didn’t exist in 8.0.1 and earlier !
    Same bugg happens:
    with image display (classic),
    when trying to create a constant from a
    local variable of these indicators,
    when trying to create a constant on the
    connector of a subVI for these indicators.
    Message Edité par TiTou le 10-23-2006 08:38 AM
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    bugg_image_display.png ‏234 KB

    Hello,
    Thank you for reporting this.  A CAR has been filed on the issue - for reference the CAR ID is 4308NMSQ.
    Best Regards,
    JLS
    Standard Response:
    This was reported to R&D (4308NMSQ CAR ID) for further investigation. Thanks for the feedback!
    Best,
    JLS
    Sixclear

  • Graticule or horizontal/verticle ruler in image display

    Hi all,
    Is it possible to put a graticule, ruler or horizontal and vertical ruler embedded in the image display.basically overlaying the image display .
    Please let me know
    - Thanks

    Trevor-B wrote:
    Hi, 
    I noticed that you have another active thread on overlaying a grid on an image: http://forums.ni.com/t5/LabVIEW/Ruler-or-scale-in-a-image-display-window/m-p/2507120
    Do you have any further questions on this topic?
    Hi Trevo,
    I am able to put the x y grid using overlay line on an image display as of now this is fine for me and worsk fine for me, but for future reference is it possible to put scale, like a graticule or four coordinate scale on an image/video display indicator.
    Thanks,

  • Is there a way to turn the pattern matching example in Labview to instead of loading a rectangle around what you want the template to be you can use an image display , I've be trying and can get no where with it

    What I want to do is , have two images on image displays and the pass them through the same setup as the pattern matching example to get the number of matches , I have attached what I have done and also given the pattern matching example program as well.
    Hope to get answers back soon,
                                     Thanks Alan
    Attachments:
    screenshot.docx ‏48 KB
    Pattern Matching Example.vi ‏100 KB

    Hi there!
    The example used can be adapted for comparing two images, however the algorithm and coding for finding the differences is more specific to your actual problem. In terms of the loading and displaying of the images, this can be done in the same way.
    Once you have some sort of algorithm, then you can automate the learning and matching by simply wiring them in order. (in the example, these are put in case structures as they are waiting on response from the front panel)
    I hope that this helps,
    Liam A.
    National Instruments
    Applications Engineer

  • Most times when I import photos from my desktop or dropbox to iPhoto, iPhoto will keep the title I created for the image as the display title under the image. but occasionally it displays the filename instead and I have to go back through and reenter

    most times when I import photos from my desktop or dropbox to iPhoto, iPhoto will keep the title I created for the image as the display title under the image. but occasionally it displays the filename instead and I have to go back through and reenter the title in iPhoto. why the inconsistency? running OS 10.9.5 and using iPhoto 9.5.1

    Try this:  select one of the photos that are showing the wrong title and use the Photos ➙ Batch Change ➙ Title to File Name menu option.
    See if that will put the name that you want under the thumbnail.

  • Photos does not display generic title of image (ex: IMG_2234) as actual title. Is there a way to batch rename all photos using the generic title?

    Photos does not display generic title of image (ex: IMG_2234) as actual title. Is there a way to batch rename all photos using the generic title?

    If you launch Script Editor and open the Help menu, you will see the APpleScript Help and a Language Guide:
    To see, which commands an application understands, open the File menu in Script editor and select Open Dictionary.  In the list locate "Photos".
    You will see examples how o script Photos.

  • Image path displays instead of image

    Firefox v20.0.1, Win7 32 bit.
    This web page ( http://zone.ni.com/devzone/cda/epd/p/id/5336 ) does not display the "flowchart"image at the bottom of the page immediately following the text "The following is a map of other documents..." On a correctly working page, the image is a flowchart "navigation" image that opens new pages depending on where you click on it. In firefox only a box with an ftp path to the image is displayed in its place. I have seen the problem on other web pages as well.
    Actions taken:
    The pages displays correctly in IE v10. This problem happens on one computer. Different computer, same firefox version displays correctly. Different computer older firefox version (v17?) displays correctly.
    * I have tried disabling all plug-ins and extensions.
    * I have created a new profile. Seems like the first time I did this, the page displayed correctly, but when I refreshed (F5) the image is gone and the ftp path box is displayed. Subsequently created new profiles do not display the page correctly.
    * I have tried resetting Firefox and the page still is not displayed correctly.
    Troubleshooting:
    Ctrl-shif-K, opened the Web Console, cleared the console output, refreshed the page by pressing Ctrl-F5. The following is several lines following the first error on the console:
    [09:12:29.360] Unknown property '-moz-border-radius'. Declaration dropped. @ http://zone.ni.com/widgets/share/addthis/1.0/css/share.css:11
    [09:12:29.360] Expected declaration but found '*'. Skipped to next declaration. @ http://zone.ni.com/widgets/share/addthis/1.0/css/share.css:13
    [09:12:29.406] GET http://ct1.addthis.com/static/r07/core076.js [HTTP/1.1 200 OK 167ms]
    [09:12:29.392] Unknown property 'size'. Declaration dropped. @ http://zone.ni.com/css/global/us/zoneprint.css:15
    [09:12:29.392] Expected declaration but found '@bottom-center'. Skipped to next declaration. @ http://zone.ni.com/css/global/us/zoneprint.css:17
    [09:12:29.497] GET http://zone.ni.com/css/global/us/thecore.css [HTTP/1.1 200 OK 26ms]
    [09:12:29.452] Expected identifier for class selector but found ' '. Ruleset ignored due to bad selector. @ http://zone.ni.com/css/global/us/thecore.css:115
    [09:12:29.453] Error in parsing value for 'filter'. Declaration dropped. @ http://zone.ni.com/css/global/us/thecore.css:259
    [09:12:29.453] Error in parsing value for 'cursor'. Declaration dropped. @ http://zone.ni.com/css/global/us/thecore.css:259
    Any help is greatly appreciated.

    You can remove all data stored in Firefox from a specific domain via "Forget About This Site" in the right-click context menu of an history entry ("History > Show All History" or "View > Sidebar > History") or via the about:permissions page.
    Using "Forget About This Site" will remove all data stored in Firefox from that domain like bookmarks, cookies, passwords, cache, history, and exceptions, so be cautious and if you have a password or other data from that domain that you do not want to lose then make a note of those passwords and bookmarks.
    You can't recover from this 'forget' unless you have a backup of the affected files.
    It doesn't have any lasting effect, so if you revisit such a 'forgotten' website then data from that website will be saved once again.

  • How to specify SWF instead of an image in loading

    I hope it is not too much over my head as I would like to make it work. Some time ago I recieved help in constracting an interactive image thumb scroller using greensock features.
    My biggest problem at the moment is that I can not figure out how to change the code so the thumbs would bring up the swf files and not jpg files. In other words my small thumbnails are small jpg files (as they were intended to be), but my bigger visuals (the ones which are being brought by clicking on the small thumbnails) I would like to change to an swf file (as it contains its separate animation and additional set of buttons)
    Here is the original code I am trying to modify:
    [CODE]
    package {
    import com.greensock.TweenLite;
    import com.greensock.events.LoaderEvent;
    import com.greensock.loading.ImageLoader;
    import com.greensock.loading.LoaderMax;
    import com.greensock.loading.XMLLoader;
    import com.greensock.plugins.AutoAlphaPlugin;
    import com.greensock.plugins.ColorTransformPlugin;
    import com.greensock.plugins.GlowFilterPlugin;
    import com.greensock.plugins.TweenPlugin;
    import flash.display.MovieClip;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;
    public class SlideshowExample extends MovieClip {
      private static const _THUMB_WIDTH:Number = 100;
      private static const _THUMB_HEIGHT:Number = 64;
      private static const _IMAGE_WIDTH:Number = 550;
      private static const _IMAGE_HEIGHT:Number = 355;
      private static const _THUMB_GAP:Number = 4;
      private static const _SCROLL_SPEED:Number = 12;
      private static const _SCROLL_AREA:Number = 150;
      private var _progressBar:MovieClip;
      private var _arrowLeft:MovieClip;
      private var _arrowRight:MovieClip;
      private var _slides:Array;
      private var _curSlide:Slide; //Slide that is currently displaying
      private var _loadingSlide:Slide; //only used when a Slide is supposed to show but hasn't been fully loaded yet (like if the user clicks "next" many times before all the images have loaded). We keep track of the one that's in the process of loading and should be shown as soon as it finishes, then we set _loadingSlide back to null.
      private var _imagesContainer:Sprite; //the Sprite into which the full-size images are placed (this helps manage the stacking order so that the images can always be behind everything else and yet we can addChild() each image so that it shows up on top of the previous one)
      private var _thumbnailsContainer:Sprite; //the Sprite into which the thumbnail images are placed. This also allows us to slide them all at the same time.
      private var _destScrollX:Number = 0; //destination x value for the _thumbnailsContainer which is used for scrolling it across the bottom. We don't want to use _thumbnailsContainer.x because it could be in the process of tweening, so we keep track of the end/destination value and add/subtract from it when creating our tweens.
      private var _minScrollX:Number; //we know the maximum x value for _thumbnailsContainer is 0, but the mimimum value will depend on how many thumbnail images it contains (the total width). We calculate it in the _setupThumbnails() method and store it here for easier/faster scrolling calculations in the _enterFrameHandler()
      public function SlideshowExample() {
       super();
       //activate the plugins that we'll be using so that TweenLite can tween special properties like filters, colorTransform, and do autoAlpha fades.
       TweenPlugin.activate([AutoAlphaPlugin, ColorTransformPlugin, GlowFilterPlugin]);
       _progressBar = this.getChildByName("progress_mc") as MovieClip;
       _arrowLeft = this.getChildByName("arrowLeft_mc") as MovieClip;
       _arrowRight = this.getChildByName("arrowRight_mc") as MovieClip;
       _arrowLeft.visible = _arrowRight.visible = false;
       _imagesContainer = new Sprite();
       this.addChildAt(_imagesContainer, 0);
       _thumbnailsContainer = new Sprite();
       addChild(_thumbnailsContainer);
       _thumbnailsContainer.y = _IMAGE_HEIGHT;
       _thumbnailsContainer.alpha = 0; //we want alpha 0 initially because we'll fade it in later when the thumbnails load.
       _thumbnailsContainer.visible = false; //ensures nothing is clickable.
       var xmlLoader:XMLLoader = new XMLLoader("assets/data.xml", {onComplete:_xmlCompleteHandler});
       xmlLoader.load();
      private function _xmlCompleteHandler(event:LoaderEvent):void {
       _slides = [];
       var xml:XML = event.target.content; //the XMLLoader's "content" is the XML that was loaded.
       var imageList:XMLList = xml.image; //In the XML, we have <image /> nodes with all the info we need.
       //loop through each <image /> node and create a Slide object for each.
       for each (var image:XML in imageList) {
        _slides.push( new Slide(image.@name,
              image.@description,
              new ImageLoader("assets/thumbnails/" + image.@name + ".jpg", {name:image.@name + "Thumb", width:_THUMB_WIDTH, height:_THUMB_HEIGHT, scaleMode:"proportionalInside", bgColor:0x000000, estimatedBytes:13000, onFail:_imageFailHandler}),
              new ImageLoader("assets/images/" + image.@name + ".jpg", {name:image.@name + "Image", width:_IMAGE_WIDTH, height:_IMAGE_HEIGHT, scaleMode:"proportionalInside", bgColor:0x000000, estimatedBytes:820000, onFail:_imageFailHandler})
       //now create a LoaderMax queue and populate it with all the thumbnail ImageLoaders as well as the very first full-size ImageLoader. We don't want to show anything until the thumbnails are done loading as well as the first full-size one. After that, we'll create another LoaderMax queue containing the rest of the full-size images that will load silently in the background.
       var initialLoadQueue:LoaderMax = new LoaderMax({onComplete:_initialLoadComplete, onProgress:_progressHandler});
       for (var i:int = 0; i < _slides.length; i++) {
        initialLoadQueue.append( _slides[i].thumbnailLoader );
       initialLoadQueue.append(_slides[0].imageLoader); //make sure the very first full-sized image is loaded initially too.
       initialLoadQueue.load();
       _setupThumbnails();
      private function _initialLoadComplete(event:LoaderEvent):void {
       //now that the initial load is complete, fade out the progressBar. autoAlpha will automatically set visible to false once alpha hits 0.
       TweenLite.to(_progressBar, 0.5, {autoAlpha:0});
       //fade in the thumbnails container
       TweenLite.to(_thumbnailsContainer, 1, {autoAlpha:1});
       _setupArrows();
       //setup the ENTER_FRAME listeners that controls the thumbnail scrolling behavior at the bottom
       this.stage.addEventListener(Event.ENTER_FRAME, _enterFrameHandler, false, 0, true);
       //now put all the remaining images into a LoaderMax queue that will load them one-at-a-time in the background in the proper order. This can greatly improve the user's experience compared to loading them on demand which forces the user to wait while the next image loads.
       var imagesQueue:LoaderMax = new LoaderMax({maxConnections:1});
       for (var i:int = 1; i < _slides.length; i++) {
        imagesQueue.append( _slides[i].imageLoader );
       imagesQueue.load();
       //now start the slideshow
       _showNext(null);
      //loops through all the thumbnail images and places them in the proper order across the bottom of the screen and adds CLICK_THUMBNAIL listeners.
      private function _setupThumbnails():void { 
       var l:int = _slides.length;
       var curX:Number = _THUMB_GAP;
       for (var i:int = 0; i < l; i++) {
        var thumbnail:Sprite = _slides[i].thumbnail;
        _thumbnailsContainer.addChild(thumbnail);
        TweenLite.to(thumbnail, 0, {colorTransform:{brightness:0.5}});
        _slides[i].addEventListener(Slide.CLICK_THUMBNAIL, _clickThumbnailHandler, false, 0, true);
        thumbnail.x = curX;
        thumbnail.y = 4;
        curX += _THUMB_WIDTH + _THUMB_GAP;
       _minScrollX = _IMAGE_WIDTH - curX;
       if (_minScrollX > 0) {
        _minScrollX = 0;
      private function _setupArrows():void {
       _arrowLeft.alpha = _arrowRight.alpha = 0;
       _arrowLeft.visible = _arrowRight.visible = true;
       _arrowLeft.addEventListener(MouseEvent.ROLL_OVER, _rollOverArrowHandler, false, 0, true);
       _arrowLeft.addEventListener(MouseEvent.ROLL_OUT, _rollOutArrowHandler, false, 0, true);
       _arrowLeft.addEventListener(MouseEvent.CLICK, _showPrevious, false, 0, true);
       _arrowRight.addEventListener(MouseEvent.ROLL_OVER, _rollOverArrowHandler, false, 0, true);
       _arrowRight.addEventListener(MouseEvent.ROLL_OUT, _rollOutArrowHandler, false, 0, true);
       _arrowRight.addEventListener(MouseEvent.CLICK, _showNext, false, 0, true);
      private function _showNext(event:Event=null):void {
       //if there's a _loadingSlide we should assume that the next Slide would be AFTER that one. Otherwise just get the one after the _curSlide.
       var next:int = (_loadingSlide != null) ? _slides.indexOf(_loadingSlide) + 1 : _slides.indexOf(_curSlide) + 1;
       if (next >= _slides.length) {
        next = 0;
       _requestSlide(_slides[next]);
      private function _showPrevious(event:Event=null):void {
       //if there's a _loadingSlide we should assume that the previous Slide would be BEFORE that one. Otherwise just get the one before the _curSlide.
       var prev:int = (_loadingSlide != null) ? _slides.indexOf(_loadingSlide) - 1 : _slides.indexOf(_curSlide) - 1;
       if (prev < 0) {
        prev = _slides.length - 1;
       _requestSlide(_slides[prev]);
      private function _requestSlide(slide:Slide):void {
       if (slide == _curSlide) {
        return;
       //kill the delayed calls to _showNext so that we start over again with a 5-second wait time.
       TweenLite.killTweensOf(_showNext);
       if (_loadingSlide != null) {
        _cancelPrioritizedSlide(); //the user must have skipped to another Slide and didn't want to wait for the one that was loading.
       //if the requested Slide's full-sized image hasn't loaded yet, we need to show the progress bar and wait for it to load.
       if (slide.imageLoader.progress != 1) {
        _prioritizeSlide(slide);
        return;
       //fade the old Slide and make sure it's not highlighted anymore as the current Slide.
       if (_curSlide != null) {
        TweenLite.to(_curSlide.image, 0.5, {autoAlpha:0});
        _curSlide.setShowingStatus(false);
       _curSlide = slide;
       _imagesContainer.addChild(_curSlide.image); //ensures the image is at the top of the stacking order inside the _imagesContainer
       TweenLite.to(_curSlide.image, 0.5, {autoAlpha:1}); //fade the image in and make sure visible is true.
       _curSlide.setShowingStatus(true); //adds an outline to the image indicating that it's the currently showing Slide.
       TweenLite.delayedCall(5, _showNext); //create a delayedCall that will call _showNext in 5 seconds.
      private function _prioritizeSlide(slide:Slide):void {
       TweenLite.to(_progressBar, 0.5, {autoAlpha:1}); //show the progress bar
       _loadingSlide = slide;
       _loadingSlide.imageLoader.addEventListener(LoaderEvent.PROGRESS, _progressHandler);
       _loadingSlide.imageLoader.addEventListener(LoaderEvent.COMPLETE, _completePrioritizedHandler);
       _loadingSlide.imageLoader.prioritize(true); //when the loader is prioritized, it will jump to the top of any LoaderMax queues that it belongs to, so if another loader is in the process of loading in that queue, it will be canceled and this new one will take over which maximizes bandwidth utilization. Once the _loadingSlide is done loading, the LoaderMax queue(s) will continue loading the rest of their images normally.
      private function _cancelPrioritizedSlide():void {
       TweenLite.to(_progressBar, 0.5, {autoAlpha:0}); //hide the progress bar
       _loadingSlide.imageLoader.removeEventListener(LoaderEvent.PROGRESS, _progressHandler);
       _loadingSlide.imageLoader.removeEventListener(LoaderEvent.COMPLETE, _completePrioritizedHandler);
       _loadingSlide = null;
      private function _completePrioritizedHandler(event:LoaderEvent):void {
       var next:Slide = _loadingSlide; //store it in a local variable first because _cancelPrioritizedSlide() will set _loadingSlide to null.
       _cancelPrioritizedSlide();
       _requestSlide(next);
      private function _progressHandler(event:LoaderEvent):void {
       _progressBar.progressBar_mc.scaleX = event.target.progress;
      private function _clickThumbnailHandler(event:Event):void {
       _requestSlide(event.target as Slide);
      private function _rollOverArrowHandler(event:Event):void {
       TweenLite.to(event.currentTarget, 0.5, {alpha:1});
      private function _rollOutArrowHandler(event:Event):void {
       TweenLite.to(event.currentTarget, 0.5, {alpha:0});
      private function _enterFrameHandler(event:Event):void {
       if (_thumbnailsContainer.hitTestPoint(this.stage.mouseX, this.stage.mouseY, false)) {
        if (this.mouseX < _SCROLL_AREA) {
         _destScrollX += ((_SCROLL_AREA - this.mouseX) / _SCROLL_AREA) * _SCROLL_SPEED;
         if (_destScrollX > 0) {
          _destScrollX = 0;
         TweenLite.to(_thumbnailsContainer, 0.5, {x:_destScrollX});
        } else if (this.mouseX > _IMAGE_WIDTH - _SCROLL_AREA) {
         _destScrollX -= ((this.mouseX - (_IMAGE_WIDTH - _SCROLL_AREA)) / _SCROLL_AREA) * _SCROLL_SPEED;
         if (_destScrollX < _minScrollX) {
          _destScrollX = _minScrollX;
         TweenLite.to(_thumbnailsContainer, 0.5, {x:_destScrollX});
      //if an image fails to load properly, remove it from the slideshow completely including its thumbnail at the bottom.
      private function _imageFailHandler(event:LoaderEvent):void {
       var slide:Slide;
       var i:int = _slides.length;
       while (--i > -1) {
        slide = _slides[i];
        if (event.target == slide.thumbnailLoader || event.target == slide.imageLoader) {
         slide.dispose();
         _slides.splice(i, 1);
         _setupThumbnails();
         return;
    [/CODE]
    I could figure out that I have to change the line
    [CODE]
    new ImageLoader("assets/images/" + image.@name + ".jpg", {name:image.@name + "Image", width:_IMAGE_WIDTH, height:_IMAGE_HEIGHT, scaleMode:"proportionalInside", bgColor:0x000000, estimatedBytes:820000, onFail:_imageFailHandler}
    [/CODE]
    and instead of ".jpg" put ".swf" (making sure that the names of the files are identical except for their extensions)
    The problem is that I get an error message in the output that flash could not convert my swf file to the bitmap.
    I suspect that I have to change the hard coding to specify that Loader Max should treat loading bigger swf files as swf and not as image/jpg files.
    I don't have enough expertise to decipher all the lines where this has to be changed.
    It feels that I am close to accomplishing what I need. Is it possible to point out where this change has to take place?
    Here is my thought process:
    I don't need to specify SWFLoader as LoaderMax is already specified (line 5)
    I don't need to change anything in lines 31-34 as "Sprite" and "Slide" could be an .swf file (line31-34)
    I don't need to change anything in line 50 for the same reason (line 50)
    I don't need to change lines 66 and 68 as image list may contain swf files (line 66 and 68)
    I do need to change ".jpg" to ".swf" in line 72 (line 72)
    No sure if there are any changes in line 82 (line 82)
    LoaderMax has var as imagesQueue does that need to be changed into SFWLoader? (lines98-102)
    I don't think anything need to be changed in lines 138-173 as " Slide" can incorporate an SWF file (lines 138-173)
    Not sure if there has to be a change in lines 175-177 as it specifies that slide is an image (lines 175-177)
    Not sure if there has to be a change in lines 182-200 from imageLoager to SWFLoader (lines 182-200)
    Not sure if there has to be a change in lines 239-245 in specifying SWFLoader (lines 239-245)
    I am attaching the .xml and .as documents as well

    This was my very first step.
    The problem is that I get an error message in the output that flash could not convert my swf file to the bitmap.
    I suspect that I have to change the hard coding to specify that Loader Max should treat loading bigger swf files as swf and not as image/jpg files.
    I don't have enough expertise to decipher all the lines where this has to be changed.
    It feels that I am close to accomplishing what I need. Is it possible to point out where this change has to take place?
    Just in case here is my xml code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <data>
              <image name="agencynet" description="agencynet description text goes here." />
              <image name="buick" description="buick description text goes here." />
              <image name="cocacola" description="cocacola description text goes here." />
              <image name="cu3er" description="cu3er description text goes here." />
              <image name="diva" description="diva description text goes here." />
              <image name="dow" description="dow description text goes here." />
              <image name="erkyperky" description="erkyperky description text goes here." />
              <image name="flexa" description="flexa description text goes here." />
              <image name="happyplanetshots" description="happyplanetshots description text goes here." />
              <image name="holdencruze" description="holdencruze description text goes here." />
              <image name="ironman" description="ironman description text goes here." />
              <image name="mercedes" description="mercedes description text goes here." />
              <image name="micromaniac" description="micromaniac description text goes here." />
              <image name="overtheatlantic" description="overtheatlantic description text goes here." />
              <image name="saab" description="saab description text goes here." />
              <image name="silverpistol" description="silverpistol description text goes here." />
              <image name="softse" description="softse description text goes here." />
              <image name="target" description="target description text goes here." />
              <image name="tonydorio" description="tonydorio description text goes here." />
              <image name="prius" description="prius description text goes here." />
              <image name="waterlife" description="waterlife description text goes here." />
    </data>

  • Loading new xml data into a already xml populated image display

    Hi everybody,
    I have a question about loading new xml data into a already xml populated image gallery.
    So I have my gallery set up so it calls some xml when it first loads. What I would now like to do is load different sets of images via a different xml sheet via the click of a button.
    So for example the loaded gallery already has all thumbs loaded and user can click on them to view the full size image. So next instead of the user having to close this gallery to allow a new gallery to open with a different set of pictures I would just like to have a button. This button will unload the existing thumbs from the gallery and load in new ones from a different xml file.
    If anybody can help me with this it would be great as I am still on a steep learning curve with AS3.
    Here is my AS3
    var xmlPath:String = "pictures.xml";
    var xml:XML;
    var loader = new URLLoader();
    loader.load(new URLRequest(xmlPath));
    loader.addEventListener(Event.COMPLETE, xmlLoaded);
    function xmlLoaded(e:Event):void
         if ((e.target as URLLoader) != null )
              xml = new XML(loader.data);
              createMenu();
    var numberOfItems:uint = 0;
    var menuItems:Array = new Array();
    function createMenu():void
              numberOfItems = xml.items.item.length();
         var count:uint = 0;
              for each (var item:XML in xml.items.item)
              var imageLoader=new Loader();
              var menuItem:MenuItem = new MenuItem();
              menuItem.addChild(imageLoader);
              imageLoader.load(new URLRequest(item.url));
              menuItem.linkTo = item.linkTo;
              menuItem.mouseChildren = false;
              menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
              menuItems.push(menuItem);
              addChild(menuItem);
              count++;
    function ***():void
         //menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
         for (var i:uint = 0; i < menuItems.length; i++)
              setChildIndex(menuItems[i], i);

    Thanks so much for the reply Andrei1
    I think maybe my lack of knowledge when it comes to AS3 is not helping me at the moment because I thought I understood the code you supplied but there is something not going quite right.
    So I messed around with the code and added the new_loaded_thumbs_btn to load in the "new_pictures.xml" but I am def doing something wrong.
    import flash.ui.ContextMenuItem;
    var xmlPath:String = "pictures.xml";
    var xml:XML;
    var numberOfItems:uint = 0;
    var menuItems:Array = new Array();
    var loader = new URLLoader();
    loader.addEventListener(Event.COMPLETE, xmlLoaded);
    loadXML("pictures.xml");
    new_loaded_thumbs_btn.addEventListener(MouseEvent.CLICK, loadXML);
    function loadXML(path:String):void {
         loader.load(new URLRequest("new_pictures.xml"));
    function loadXML(path:String):void {
         loader.load(new URLRequest(path));
    function xmlLoaded(e:Event):void
         xml = new XML(loader.data);
         createMenu();
    function createMenu():void
         clearMenu();
         numberOfItems = xml.items.item.length();
         var count:uint = 0;
         var imageLoader;
         var menuItem:MenuItem;
         for each (var item:XML in xml.items.item)
              imageLoader = Loader();
              menuItem = new MenuItem();
              menuItem.addChild(imageLoader);
              imageLoader.load(new URLRequest(item.url));
              menuItem.linkTo = item.linkTo;
              menuItem.mouseChildren = false;
              menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
              menuItems.push(menuItem);
              addChild(menuItem);
              count++;
         sortChildren();
    // removes previously placed objects
    function clearMenu():void {
         var menuItem:MenuItem;
         while (menuItems.length > 0) {
              menuItem = menuItems[0];
              removeChildAt(getChildIndex(menuItem));
              menuItem.shift();
    function sortChildren():void
         //menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
         for (var i:uint = 0; i < menuItems.length; i++)
              setChildIndex(menuItems[i], i);
    When the image display 1st loads it displays the new_pictures.xml thumbs which I thought would load through my new button when clicked.
    And there was me thinking I was getting the hang of AS3.
    Could you please point me in the right direction in what I am doing wrong,
    Thanks for your time and effort in advance

  • Extracting pointer information and displaying it as an image

    Hey,
    I am using Intel's OpenCV image processing library in LabVIEW.
    There's a pointer to a struct IplImage that is passed around in order to run image processing functions.
    The struct IplImage is defined as: 
    typedef struct _IplImage
    int nSize; /* sizeof(IplImage) */
    int ID; /* version (=0)*/
    int nChannels; /* Most of OpenCV functions support 1,2,3 or 4 channels */
    int alphaChannel; /* ignored by OpenCV */
    int depth; /* pixel depth in bits: IPL_DEPTH_8U, IPL_DEPTH_8S, IPL_DEPTH_16U,
    IPL_DEPTH_16S, IPL_DEPTH_32S, IPL_DEPTH_32F and IPL_DEPTH_64F are supported */
    char colorModel[4]; /* ignored by OpenCV */
    char channelSeq[4]; /* ditto */
    int dataOrder; /* 0 - interleaved color channels, 1 - separate color channels.
    cvCreateImage can only create interleaved images */
    int origin; /* 0 - top-left origin,
    1 - bottom-left origin (Windows bitmaps style) */
    int align; /* Alignment of image rows (4 or 8).
    OpenCV ignores it and uses widthStep instead */
    int width; /* image width in pixels */
    int height; /* image height in pixels */
    struct _IplROI *roi;/* image ROI. when it is not NULL, this specifies image region to process */
    struct _IplImage *maskROI; /* must be NULL in OpenCV */
    void *imageId; /* ditto */
    struct _IplTileInfo *tileInfo; /* ditto */
    int imageSize; /* image data size in bytes
    (=image->height*image->widthStep
    in case of interleaved data)*/
    char *imageData; /* pointer to aligned image data */
    int widthStep; /* size of aligned image row in bytes */
    int BorderMode[4]; /* border completion mode, ignored by OpenCV */
    int BorderConst[4]; /* ditto */
    char *imageDataOrigin; /* pointer to a very origin of image data
    (not necessarily aligned) -
    it is needed for correct image deallocation */
    IplImage;
    I am having problems with closing OpenCV's GUI window when called from LabVIEW in Linux. A solution to this may be to not use OpenCV's GUI window in LabVIEW for Linux, but rather pass back the pointer to the processed image in LabVIEW. From that pointer, we can send it to a C wrapper to extract some information that we want from the struct in order and pass back those values to LabVIEW. Then LabVIEW will process those values and display the image. What will I need to extract from the pointer (via a C wrapper) in order to display the image onto LabVIEW?
    I attached a LabVIEW example that I found. This example loads and displays an image. I am thinking of doing something similar to that. Instead of loading an image from the file dialog, I will pass all of the necessary information to Draw Flattened Pixmap.
    Attachments:
    Picture4.vi ‏56 KB

    My description of my problems with interfacing OpenCV with LabVIEW is contained in this discussion
    Basically, the code works in C in Linux, C in Windows, LabVIEW for Windows, but not in LabVIEW for Linux.
    We finally were able to get OpenCV to interface with LabVIEW for Linux by doing some complex edition to make install. However, LabVIEW was still having trouble with the function to close all HighGUI windows. Even though it went through the function, it will not close the HighGUI window. Also the HighGUI window freezes and when it eventually closes, it crashes LabVIEW.
    When I test it by writing C programs, the function does what it is supposed to do.

  • Imaq windraw vs. Imaq image display

    Until recently, i've been using the imaq windraw vi to display the real time images i capture. Now I am trying to use the imaq image display vi instead...the only problem is that it slows my application way down. Does anyone know why it would slow the application down so much? With windraw i processed about 900 images a minute, but with the image display i only process half that many. Does it have something to do with the image display being part of the GUI??

    Most likely the slow down does have to do with the image being displayed as part of the GUI. There are some things that you can do to increase performance. Take a look at this KB for some good suggestions.

Maybe you are looking for

  • Tabel name for PO and Invoice combination

    Hi, Can any one help me, which table we can use to find whether the invoce complete or not for the list of PO's or GR's. If there is no standard table, then advice me how to see the list of 100 po's which have completed invoice or not? Thanks, Saran

  • Using getDate for ResultSet in jsp

    Hello, In a jsp I'm trying to display a date stored in a mysql database. In the jsp i have put the following: <TD align='right'>Meeting Date</TD> <TD align='right'> <INPUT type='text' name='meetingDate' value='<%= rsClients.getDate("meetingDate") %>'

  • My Photoshop Elements 12 Editor has stopped working

    ion

  • Adobe Reader XI signing allowed strange issue

    Hi! All of  our users are using Adobe Reader XI. They are asked to convert their work schedule into PDF (Ms Excel Save as PDF). The strange thing we noticed is , some of  them can do digital certificate signing (Their PDF  security has signing allowe

  • Excel Memory Issue

    Hello.  As soon as I enter data into an Excel sheet, or when I try to save one, I receive the message "Microsoft Excel cannot open or save any more documents because there is not enough memory or available disk space".  However, there is plenty of bo