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>

Similar Messages

  • How to specify relative path for background image  in xsl

    Hi,
    I am generating a PDF from Apcahe FOP. I have an xsl for that, in the xsl fo:block I am displaying a background image. When the image path is absolute like..C:\image\logo.png it works fine. But I want to have the image in my WebContent\images folder and my xsl file is in WebContent\xsls folder. So when I try giving the relative path as ../images/logo.png, the image is not displayed.
    Can anyone tell how to do this???
    Thanks,
    Sanjeev.

    I have a fo:block like this :
    <fo:block border-style="solid" border-width="0.2pt" text-align="left"
                             background-image="url('http://localhost:8080/Project/images/table_header_center.png')"
                             font-size="8pt" font-weight="bold" color="white" padding-top="1pt"
                             padding-bottom="1pt">
                             <xsl:value-of select="tr/td/span" />
                        </fo:block>In the above code you can see that the the background-image="url('http://localhost:8080/Project/images/table_header_center.png')"
    has been given as absolute. The images folder is in my WebContent directory. I want this path to be relative to the context of my application , something like background-image="url('../images/table_header_center.png')".
    Thanks.
    sanjeev.

  • How to tell if an Image is loaded using Toolkit.getImage()

    If I use Toolkit.getImage(url) it always returns an Image object, no matter if the image located at that url is a correct image or not.
    The w/h is always -1, -1 right after loading (since it hasn't been loaded completely of course).
    Anyone know how I can tell if a correct image is loaded or not, without adding a MediaTracker?

    Why don't you want to use a MediaTracker? It is by far the most convenient way to do what you want to do.
    Huw

  • How to anchor zoom point in ScrollViewer+Image?

    I'm using the following XAML to allow the user to pan and zoom with an image:
    <ScrollViewer x:Name="scrollViewer" HorizontalSnapPointsType="None" HorizontalScrollBarVisibility="Auto" VerticalSnapPointsType="None" ZoomSnapPointsType="None" IsHorizontalRailEnabled="False" IsVerticalRailEnabled="False" ManipulationMode="All" VerticalScrollBarVisibility="Auto" ManipulationDelta="ScrollViewer_ManipulationDelta_1" IsDoubleTapEnabled="False" IsRightTapEnabled="False" IsTapEnabled="False">
    <Image x:Name="pannableImage" Source="{Binding FullSizedImage}" ManipulationMode="All" Loaded="pannableImage_Loaded" IsDoubleTapEnabled="False" IsHitTestVisible="False" IsHoldingEnabled="False" IsRightTapEnabled="False" IsTapEnabled="False" ScrollViewer.VerticalScrollBarVisibility="Disabled" LayoutUpdated="pannableImage_LayoutUpdated">
    <Image.RenderTransform>
    <TransformGroup>
    <ScaleTransform x:Name="Scale" />
    <RotateTransform x:Name="Rotate" />
    <TranslateTransform x:Name="Translate" />
    </TransformGroup>
    </Image.RenderTransform>
    </Image>
    </ScrollViewer>
    What I want to be able to do is keep the starting point of the zoom in the same place on the screen as the user zooms in or out.
    In order to do that, I need to know the coordinates in the image where the zoom is starting so that I can then:
    Get the screen coordinates for the image coordinates before the new scale factor is applied.
    Get the screen coordinates for the image coordinates after the new scale factor is applied.
    Adjust the translate transform so that the position stays the same
    My problem lies in getting the point that the user is starting the zoom and then translating that into the underlying coordinates in the image.
    I've tried:
    private void scrollViewer_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
    Debug.WriteLine("scrollViewer_ManipulationStarted: position = {0},{1}", e.Position.X, e.Position.Y);
    GeneralTransform gt = pannableImage.TransformToVisual(scrollViewer);
    GeneralTransform gti = gt.Inverse;
    Point pt = gti.TransformPoint(e.Position);
    Debug.WriteLine("scrollViewer_ManipulationStarted: image pos = {0},{1}", pt.X, pt.Y);
    but the "image pos" numbers aren't right. It doesn't seem to matter if I pass scrollViewer or null to TransformToVisual.
    This is for a Windows Universal App so needs to work on both Windows 8.1 and Windows Phone 8.1.
    Can someone please advise a solution?
    Thanks.

    Hi Herro
    Thank you for suggesting that code sample. It certainly does support zooming in and out beneath the manipulation point.
    However, I am struggling to modify my existing implementation to support that different approach. There are a few areas where I'm having trouble and it may be that I just don't fully understand how the transforms work.
    When the image is loaded, I want to make sure that, initially at least, the image is scaled so that it fits onto the screen. I'm using various events to trigger that initialisation but the core of the code is this:
    double visibleHeight = Window.Current.Bounds.Height; // scrollViewer.ViewportHeight; //
    double visibleWidth = Window.Current.Bounds.Width; // scrollViewer.ViewportWidth; //
    // Get the image dimensions, allowing for rotation. We can be certain about
    // using the values of 0, 90, 180, 270 because the rotation is always done in
    // multiples of 90.
    double imageHeight, imageWidth;
    if (Math.Abs(selectedObject.Rotation) == 180 || selectedObject.Rotation == 0)
    imageHeight = ManipulateMe.ActualHeight;
    imageWidth = ManipulateMe.ActualWidth;
    else
    imageWidth = ManipulateMe.ActualHeight;
    imageHeight = ManipulateMe.ActualWidth;
    // If the image is larger than a screen dimension, work out
    // what factor we want to make that dimension fit.
    double scaleX, scaleY;
    if (imageWidth > visibleWidth)
    scaleX = visibleWidth / imageWidth;
    else
    scaleX = 1.0;
    if (imageHeight > visibleHeight)
    scaleY = visibleHeight / imageHeight;
    else
    scaleY = 1.0;
    // Pick the SMALLER of the scale factors so that we ensure both
    // dimensions fit onto the screen. Smaller because the values
    // should be less than 1, so the smaller the value, the more the
    // image is going to be reduced in size.
    double scale;
    if (scaleX < scaleY)
    scale = scaleX;
    else
    scale = scaleY;
    // Don't allow scale to be MORE than 1, at least initially. User can zoom in later.
    if (scale > 1.0)
    scale = 1.0;
    if (scale != 1.0)
    _compositeTransform.TranslateX = 0.0;
    double scaledHeight = imageHeight * scaleY;
    _compositeTransform.TranslateY = -(visibleHeight - scaledHeight) / 2;
    _compositeTransform.CenterX = ManipulateMe.ActualWidth / 2;
    _compositeTransform.CenterY = ManipulateMe.ActualHeight / 2;
    _compositeTransform.ScaleX = _compositeTransform.ScaleY = scale;
    Rect imageRect = _compositeTransform.TransformBounds(new Rect(0.0, 0.0, ManipulateMe.ActualWidth, ManipulateMe.ActualHeight));
    double visibleLeft = 0, visibleTop = 0;
    // Need to ensure that the image is positioned top-left
    if (imageRect.Left != visibleLeft)
    _compositeTransform.TranslateX = visibleLeft - imageRect.Left;
    if (imageRect.Top != visibleTop)
    _compositeTransform.TranslateY = visibleTop - imageRect.Top;
    Now, when the page loads and displays the image, the image is perfect - scaled and positioned just right. However, if I then try to move the image, it vanishes and debugging information shows that the coordinates of the image are all over the place.
    I *suspect* that the problem is being caused by my code setting up these initial values. My problem is that I don't know when to reset them or to what values.
    My next problem is to do with the panning. I want to ensure that the user doesn't lose the image, so I want to ensure that when the image is larger than the screen, the right hand edge of the image can be off to the right but cannot move more to the left
    than the right hand edge of the screen. Similarly for the other three sides of the image. My code works but it causes "bounces" in that the image seems to move back away from the screen edge and then back again to where I had "locked"
    the edge. Again, it may be because I need to reset a translation value but I just don't know when or what to.
    Below is my modified version of the ManipulationDelta routine:
    void ManipulateMe_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
    if (forceManipulationsToEnd)
    e.Complete();
    return;
    _previousTransform.Matrix = _transformGroup.Value;
    Point center = _previousTransform.TransformPoint(new Point(e.Position.X, e.Position.Y));
    _compositeTransform.CenterX = center.X;
    _compositeTransform.CenterY = center.Y;
    // Reset rotation when user moves image around
    _compositeTransform.Rotation = 0;
    _compositeTransform.ScaleX = _compositeTransform.ScaleY = e.Delta.Scale;
    Rect imageRect = ManipulateMe.RenderTransform.TransformBounds(new Rect(0.0, 0.0, ManipulateMe.ActualWidth, ManipulateMe.ActualHeight));
    Debug.WriteLine("LTRB: {0},{1},{2},{3}", imageRect.Left, imageRect.Top, imageRect.Right, imageRect.Bottom);
    double visibleHeight = Window.Current.Bounds.Height; // scrollViewer.ViewportHeight; //
    double visibleWidth = Window.Current.Bounds.Width; // scrollViewer.ViewportWidth; //
    double visibleLeft = 0, visibleRight = visibleWidth, visibleTop = 0, visibleBottom = visibleHeight;
    double xAdjustment = e.Delta.Translation.X;
    double yAdjustment = e.Delta.Translation.Y;
    // If the image is SMALLER than the screen, don't let the edges of the image go beyond the screen edges
    // If the image is LARGER than the screen, make sure that the edges of the image are either all outside
    // the screen edges or stuck to the screen edges.
    if (imageRect.Width <= visibleWidth)
    Debug.WriteLine("... image is narrower than the screen");
    // Lock to the left hand side
    if ((imageRect.Left + xAdjustment) != visibleLeft)
    xAdjustment -= (imageRect.Left + xAdjustment - visibleLeft);
    else
    //Debug.WriteLine("... image is wider than the screen");
    if ((imageRect.Right + xAdjustment) < visibleRight)
    Debug.WriteLine("... stopping image from moving off the right edge");
    Debug.WriteLine("... right before adjustment = {0}", imageRect.Right);
    Debug.WriteLine("... adjustment is {0}", xAdjustment);
    Debug.WriteLine("... so potential new right is {0}", imageRect.Right + xAdjustment);
    xAdjustment = (visibleRight - imageRect.Right);
    Debug.WriteLine("... new adjustment is {0}", xAdjustment);
    Debug.WriteLine("... and new right is {0}", imageRect.Right + xAdjustment);
    if ((imageRect.Left + xAdjustment) > visibleLeft)
    Debug.WriteLine("... stopping image from moving off the left edge");
    Debug.WriteLine("... left before adjustment = {0}", imageRect.Left);
    Debug.WriteLine("... adjustment is {0}", xAdjustment);
    Debug.WriteLine("... so potential new left is {0}", imageRect.Left + xAdjustment);
    xAdjustment = (visibleLeft - imageRect.Left);
    Debug.WriteLine("... new adjustment is {0}", xAdjustment);
    Debug.WriteLine("... and new left is {0}", imageRect.Left + xAdjustment);
    if (imageRect.Height <= visibleHeight)
    Debug.WriteLine("... image is shorter than the screen");
    // Lock to the top
    if ((imageRect.Top + yAdjustment) != visibleTop)
    yAdjustment -= (imageRect.Top + yAdjustment - visibleTop);
    else
    //Debug.WriteLine("... image is taller than the screen");
    if ((imageRect.Bottom + yAdjustment) < visibleBottom)
    Debug.WriteLine("... stopping image from moving off the bottom edge");
    Debug.WriteLine("... bottom before adjustment = {0}", imageRect.Bottom);
    Debug.WriteLine("... adjustment is {0}", yAdjustment);
    Debug.WriteLine("... so potential new bottom is {0}", imageRect.Bottom + yAdjustment);
    yAdjustment = (visibleBottom - imageRect.Bottom);
    Debug.WriteLine("... new adjustment is {0}", yAdjustment);
    Debug.WriteLine("... and new bottom is {0}", imageRect.Bottom + yAdjustment);
    if ((imageRect.Top + yAdjustment) > visibleTop)
    Debug.WriteLine("... stopping image from moving off the top edge");
    Debug.WriteLine("... top before adjustment = {0}", imageRect.Top);
    Debug.WriteLine("... adjustment is {0}", yAdjustment);
    Debug.WriteLine("... so potential new top is {0}", imageRect.Top + yAdjustment);
    yAdjustment = (visibleTop - imageRect.Top);
    Debug.WriteLine("... new adjustment is {0}", yAdjustment);
    Debug.WriteLine("... and new top is {0}", imageRect.Top + yAdjustment);
    _compositeTransform.TranslateX = xAdjustment;
    _compositeTransform.TranslateY = yAdjustment;
    e.Handled = true;
    Many thanks for any suggestions you can make.
    Regards
    Philip

  • When I open an album, thumbnail appear as dotted outlines instead of the image itself. Are my settings set improperly? How do I fix this?

    when I open an album, thumbnail appear as dotted outlines instead of the image itself. Are my settings set improperly? How do I fix this?

    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Include the option to rebuild the thumbnails. It can take 3 or 4 goes for this to work

  • TS3274 If I touch camera icon, the screen turns black instead of capturing image. Let me know how to troubleshoot.

    If I touch camera icon, the screen turns black instead of capturing image. Let me know how to troubleshoot?

    Try closing the Camera app:
    1. Double-click the Home button to reveal the Task Bar
    2. Hold down the Camera app for a second or two until you see the minus sign
    3. Tap the minus sign to close app
    4. Tap area above Task Bar to return to Home screen
    If the above doesn't solve the problem, do a reset:
    Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo. Ignore the red slider

  • So how to specify different answer file for different install images in WDS snap-in?

    hello
    in WDS snap-in, in properties on server name, on client tab, we can define an answer file for unattended windows installation on WDS clients.
    my question is, maybe we have added multiple images in WDS snap-in (win xp image, win 7 , win 2008,...)
    now this one answer file applies to all of them ?
    so how to specify different answer file for different install images in WDS snap-in?
    thanks in advanced 

    Under the "Client" tab of WDS, you should only use an answer-file with settings relevant for the installation. This would be credentials for the WDS deployment share, international settings used during the setup and possibly also destination drive
    details (if you want the installation to take care of partitioning the disk etc). The settings relevant for unattend-files used under "Client" would only be of those in phase 1 (WinPE).
    However, if you would like to have specific unattend file for every installation, e.g. Win7, Server 2008, Win 8 etc, you can browse to the image under "Install Images" under the image Groups. There you can select properties for every image and
    have a personal unattend-file.
    hi Joel
    very cool. thanks a lot, that really helped me.
    best regards

  • Display SWFs instead of images?

    Hi all,
    I built some dynamic pages using ADDT, and on some of the pages, the customer wants .swf files to display instead of an image. I added a field in my mysql database that holds the path to the flash files (for example...."flash/file-1.swf"), and then I tried to put a "placeholder" and bind the field from the recordset I created. However, this didnt work.
    Is there a way to pull and place an swf onto a dynamic page like this? What am I doing wrong?
    Any help is appreciated
    John

    Hi Shane,
    I didnt think it would be hard to do either, and maybe its just because I am juggling 5 other projects that I dont have the focus right now and its making this more difficult.
    Ok, I can post code but Ill tell you what I did. I created several flash files for each page (i.e. 1.swf, 2.swf, 3.swf, etc) and then in my MySQL database, I added a field to hold the path to those files for each page.
    In my page I created a filtered recordset. I place in the swf file where i wanted it and then went to the file field (this is in Dreamweaver) then opened the dialog box. Then I hit "Data Sources" and selected the correct field from my recordset that holds the path in the db.
    When I got to test the page, nothing comes up where the swf should be. When I look at the code, it is correctly bringing up the source from the database, its just not showing the file.
    Any ideas?

  • How to specify Single in memory instance of a jar in an ear

    i have an ear, containing 3 wars and 2 jars. these jar files are utility jar. and one of them has business logic lets say it application.jar. All the three wars use this jar. When ever a war file uses this jar, it gets its seperate memory instance. i want to make all the three wars use same single in memory instance of application.jar. but i dont know how to specify it. i am using websphere6.1. it will be great if someone can help me. thnx
    Ehtsham

    It's a pity !
    My problem is I tryed to save a FXG file containing images into a swf that will be able to change images sources dynamically.
    To do that, I create an empty FLA document (using JSFL), I import the FXG file into the scene.
    If I export my file into SWF in which I have injected this ActionSctipt :
    for (var x = 0; x < numChildren; x++)
      var e = getChildAt(x);
      trace(e + " " + e.name +" is "+getQualifiedClassName(e));
    I have this trace : [object MovieClip] _IMG_ is flash.display::MovieClip
    I think I cannot change the source of a MovieClip using ActionScript. Maybe I'm wrong ?
    So I would like to replace these objects (using JSFL) with UILoaders and setting the same x,y,width,height,source and then I will be able to change their sources using ActionScript.

  • How I use swf in swf (nested) ?

    Flash is case-sensitive in naming(symbols,form
    fields,components) ?
    How I use ScrollPane ?
    How I use swf in swf (nested) ?

    What I've done in the past is created an image using an image editor like MS Paint,  then change the image to black/white instead of color, and used grey instead of black.  Then upload the image via SE78.  Then you can include the image in your sapscript using the BITMAP statement.  Search for watermark in this forum and you should get some more info.
    BITMAP ZIMAGE OBJECT GRAPHICS ID BMAP TYPE BCOL
    Regards,
    Rich Heilman

  • I don't get a fluent blending( the transparant 'checkboard layer' merge with  the images instead) of the images i like to blend

    I like to fluently blend in more images , When i use the gradient tool and hold down the shift key to draw a line , i see no fluent transition of the two images, instead part of image fades into a tranpanrant ' check board' layer instead.
    What goes wrong here?
    Blending Multiple Images in Photoshop | IceflowStudios - YouTube
    I am refering to the tutorial above..

    Yes, I understand it's not always easy to grasp to what goes on on the other side.
    I already tried the above though nothing seemed to work
    I had to use the paint brush as well but  in reverse setting to get the desired result. If I dont use paint brush the checkboard appears  thus it wont merg/ blend the images.
    I don't understand how the guy in the video did this  but with photoshop cc 2014 it seems to work different, apparantly.

  • 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!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to embed swf in fla?

    can anyone help me how to embed swf to an fla?
    thnx!

    If the swf has actionscript in it, then you cannot embed it and still have it work (it will lose its code), so you need to load the file dynamically instead.

  • Render a swf object(contains an image) in navigator not possible

    Hy, I have a swf object that is an image(a circle). I have tried to render it in firefox but it doesnt render anything but I have tried with other swf object(not an image, an application) and it renders it ok. So can I render a swf file that is an image or is not possible? should I extract the image in it first to render on the navigator?
    Thanks

    Take a look at
    http://developers.sun.com/jscreator/learning/tutorials
    /2/file_upload.html#07.Thanks jetsons. That particular code sample (#7 in SJSC, #8 in Netbeans) shows only how to serialize a file to a different location on the server, not how to reference a file (not stored within the app forlder) to be rendered as a result of hyperlink click for example. Reading a little further in that page, it says:
    Be careful when putting the uploaded files in the web application as anyone can access the files by URL, such as http://localhost:29080/MyWebApplication/faces/upload/images/myPicture.gif.
    So, I am thinking that for added security, may be it is meant to be that I can't make an imageComponent reference a file outside of the wep app folder, but I am just guessing. In which case, I will simply have to store all such files within the web app folder before attempting to access them, unless someone has a better answer.

  • I need to display pie chart data tips at specified location instead of default location?

    I need to display pie chart data tips at specified location instead of default location?
    can any body let me know how to do that?
    thanks guys.

    Hi,
    Check this thread.
    Log for J2EE Web Services?
    Regards,
    Harini S

Maybe you are looking for

  • Unrepairable Disc after 10.4.8 update

    After using software update to install the current combined 10.4.8, I am now unable to start my mac due to a kernal panic that happens at startup. I used disc utilitis to check and repair my disc, I find that the illigeal name, unable to repair 1 vol

  • Call sms filter option

    Many more time try to get this above feture in my Lumia 720 phone.still we have not received this option.kindly help

  • LR4.1 - external editing - metadata not recognised on re-importing

    I use 2 external editors in my work. Nik SilverEfex Pro 2 and Portrait Professional. SE creates Tiffs to work on, PP creates PSD files. I can use both plugins fine and export and tweak my images. However, my problems start on the re-import stage. So,

  • Where is the Kick command located in the CLI?

    I have used this before to restart the proxy but I can't recall where it's @...anyone know ? Thanks!

  • Playlist Broadcaster problems after 24 hours

    I have a simple video (MPEG4 video/AAC audio) that continually loops. It seems that after 24 hours, when the video is access in QuickTime Player or the plugin in a web page that the audio will drop out but the video continues to play OR the video wil