Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 955733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:25:52+00:00 2026-05-16T00:25:52+00:00

I have an image gallery which loads a detail image, then draws a line

  • 0

I have an image gallery which loads a detail image, then draws a line next to the image on one side based on image dimensions. Clicking on the image returns one back to the main image thumbnail list, then clicking a thumb loads another image into detail holder. Everything works fine with it, except that the lines, rather than disappearing upon detail image unload, accumulate. Is there a way to clear the contents of the lineDrawing MovieClip without removing it from the stage, so that I can draw a new line in it? I’ve tried removeChild on the MovieClip, but then the lines disappear entirely, same with placing lineDrawing.clear() at the top of the setupDetail function. Here is my (relevant)code so far, any assistance will be greatly appreciated, I am stumped!

var detailImage:Loader = new Loader();
var lineDrawing:MovieClip = new MovieClip();

setupDetail();

function setupDetail():void {
    detail.visible = false;
    detail.buttonMode = true;
    detail.closeMessage.mouseEnabled = false;

    detail.addChild(detailImage);

    detailImage.contentLoaderInfo.addEventListener(Event.COMPLETE, fullyLoaded);

    // make sure detail is above the gallery
    addChild(detail);

    detail.addEventListener(MouseEvent.CLICK, onCloseDetail, false, 0, true);
}

function fullyLoaded(evt:Event):void {

    var imgHeight:int = evt.target.content.height;
    var imgWidth:int = evt.target.content.width;

    var hOffset:int = imgWidth + 5 + 27;
    var vOffset:int = imgHeight + 5;

    detail.addChild(lineDrawing);

    if(imgWidth == 600) {
        lineDrawing.graphics.lineStyle(3,0x9a9345);
        lineDrawing.graphics.moveTo(28,vOffset);
        lineDrawing.graphics.lineTo(626,vOffset);
    }
    else if(imgHeight == 600) {
        lineDrawing.graphics.lineStyle(3,0x9a9345);
        lineDrawing.graphics.moveTo(hOffset, 1);
        lineDrawing.graphics.lineTo(hOffset, 599);
    }
}

function onCloseDetail(evt:MouseEvent):void {

    // only allow it to be closed if it is at least 90% opaque
    if (detailImage.alpha>.9){
      detailImage.unload();
      TweenLite.to(detail,.5, {autoAlpha:0});
      detailImage.unload();
      detail.visible = false;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:25:53+00:00Added an answer on May 16, 2026 at 12:25 am
    lineDrawing.graphics.clear()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

what i want to do is that i have a nice image Gallery which
I have created a XML image gallery, which displays text in between each slide.
Hi I have a gallery in my app which shows the image in an
i have created a gallery script, which first loads images to be shown http://bit.ly/9aQdr3
I'm using simple gallery script which dynamically loads image when user clicks on thumbnail
I have application which loads images like this: someImage = Image.FromFile(@picture.png); and another application
I've already got a background image. But i'm builid a gallery which would have
I have an image gallery which pulls in random images from the folder images/flip_images/.
I have a custom image gallery which populates a div with thumbnails, each contained
I have an Activity which is used as an image gallery and works quite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.