Hi guys im completely new to this so go easy
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Hi guys im completely new to this so go easy

  1. #1
    Registered User
    Join Date
    May 2013

    Hi guys im completely new to this so go easy

    Hi guys basically I have to make a interactive Ebook in flash for a university project, Iíve been getting along ok so far but Iíve come unstuck a bit on one part. In this bit the user needs to take some gin and tonic to his grandma to progress to the next stage of the story. What I want to happen is that when they drag and drop the items on the grandma character they disappear then when both items have been placed on her it goes to the next page of the story. what is happening is the first item will disappear but the second wont thus no progression, I am not getting any errors in the compiler so I donít know whatís wrong with it, could anyone please help? Hereís the code

    import flash.events.MouseEvent;
    import fl.motion.MotionEvent;


    Back6_btn.addEventListener(MouseEvent.CLICK, onBack6Click)

    function onBack6Click(event:MouseEvent):void{
    Forward6_btn.addEventListener(MouseEvent.CLICK, onForward6Click)

    function onForward6Click(event:MouseEvent):void{
    gotoAndPlay('Brother bit');

    var inGran:Number=0;

    Gin.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);
    Tonic.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);

    function dragOn(event:MouseEvent):void {
    stage.addEventListener(MouseEvent.MOUSE_UP, dragOff);

    function dragOff(event:MouseEvent):void {
    if (event.target.dropTarget!=null&&event.target.dropT arget.parent==Gran) {
    stage.removeEventListener(MouseEvent.MOUSE_UP, dragOff);

    function checkPage(e:Event):void {
    if (inGran==2) {

    Thanks in advance!

  2. #2
    Senior Member
    Join Date
    Nov 2012
    You need to call your checkPage function after you increment your inGran variable

    if (event.target.dropTarget!=null&&event.target.dropT arget.parent==Gran) {
    I also dont see why you need to pass an event into the checkPage function.

    Does it matter which item is dropped first?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center

Poll by Flashkit.com