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 956081
In Process

The Archive Base Latest Questions

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

I was creating a drap and drop simple game, dragging and dropping an item

  • 0

I was creating a drap and drop simple game, dragging and dropping an item from within a movie clip. All was working fine, but then I had to add more items so I created a ScrollPane and referenced the movie clip through that, now I need to rework how I pull reference that movieclip again.

The movieclip is exported so the scrollpane can bring it in…

before:

package {

    import flash.display.*;
    import flash.geom.Point;
    import flash.events.*;

    public class shopping extends Sprite {

        public function shopping() {

            shoppinglist.Ketch.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
            shoppinglist.Ketch.addEventListener(MouseEvent.MOUSE_UP, dropIt);

Any help welcome… And hope this makes sense…

**Edit

Still really struggling on this, here is my code:

package {

    import flash.display.*;
    import flash.events.MouseEvent;
    import flash.geom.Point;
    import flash.events.KeyboardEvent;
    import flash.events.*;

    public class shopping extends MovieClip {

        public function shopping() {

            var counter:Number = 0;
            var startX:Number;
            var startY:Number;
            var budget:Number = 25
            scoreText.text = 'You have £'+budget+' for your weekly shop';
            priceText.text = '£'+budget;


            ScrollList.Ketch.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
            ScrollList.Ketch.addEventListener(MouseEvent.MOUSE_UP, dropIt);

            public function pickUp(e:MouseEvent):void {
                e.target.startDrag(true);
                reply_txt.text = "";
                e.target.parent.addChild(e.target);
                startX = e.target.x;
                startY = e.target.y;
            }

            public function dropIt(e:MouseEvent):void {
                e.target.stopDrag();
                if (e.target.dropTarget != null && e.target.dropTarget.parent == trolley){
                    //reply_txt.text = "Good Job!";
                    e.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
                    e.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
                    e.target.buttonMode = false;
                    //e.target.x = trolley.x;
                    //e.target.y = trolley.y;

                    if(e.currentTarget.name == 'Ketch'){
                        budget -= 1.25;
                        scoreText.text = 'You have £'+budget+' for your weekly shop';
                    }

                    counter++;
                } else {
                    //reply_txt.text = "Try Again!";
                    e.target.x = startX;
                    e.target.y = startY;
                }
                if(counter == 4){
                    reply_txt.text = "Congrats, you're finished!";
                }
            }

            ScrollList.Ketch.buttonMode = true;
        }
    }
}
  • 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:29:17+00:00Added an answer on May 16, 2026 at 12:29 am

    Well here is the little code that might help

    var Gotparent;

    var myobj ;

    public function pickUp(e:Event):void
    {

     myobj      =  (evt.currentTarget)
    
     Gotparent  =   myobj.parent;
    
     addChild(myobj);
    
     myobj.startDrag(true);
    

    }

    public function dropIt(e:Event):void
    {
    myobj.stop();
    Gotparent.addChild(myobj);
    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Creating a simple RPG game, first time using XNA. Trying to get my character
Creating a google map with store locations within 50 miles of user entered address.
creating 20 viewcontrollers and calling them one after the other from the mainviewcontroller as
Creating simple php login scripts is easy, with simple one table mysql integration. I
Creating a watch on a TreeNode , for example, displays an expandable watch item
Creating a popup window from main page with window.open, the child/popup page uses the
Creating a simple TCP server based on examples but still do not get how
Creating my tables from my models.py . I donno how to do 2 things
Is there any material/tutorials available that can shed some light on creating drap and
Creating a simple UI using MS Access, hoping to do minimal actual coding (actually

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.