hittestpoint help

I have a built-in gif image that is loaded as a bitmapasset and transparency. It is a child of a sprite that is used as his canvas. A click on the canvas, I need to be able to check if the user has clicked on a box transparent image or not.

Hittestpoint (on the canvas bitmapasset or sprite) fire even when the click occurs in the transparent areas of the image and using hittest on the bitmapasset never fires.

How can I test for transparency from a point on which the user clicks a bitmapasset gif image that is inside a sprite?

OK, I found the problem. My image has been resized from the original bitmapdata that was used to create it, which throws the hittestpoint. I just needed to increase the x and y values of the point test based on the current and initial width and height of the object.

Tags: BlackBerry Developers

Similar Questions

  • Help! retrieve data hitTestPoint as a matrix, or a list? or similar

    Hello, all you Flash programmers. I'm kinda a noob, sorry, but have a problem quite complex. May see a resolution in my mind, I'm fighting to create a script to solve.

    Good enough I made a small application flash for a project in College, so I have a tree that this beats little creates Earth on.

    I drew the tree as an MC and then use hitTestPoint function to check the weather from the central point of each character of the bat is in contact with the tree. If so land... blah blah is fairly simple.

    Except that I need to create a function that generates these characters on the tree actually randomly. So to do this I would ideally have a get function that collects all the x and is pointing on the and stores that data in a list.

    Then I could randomly choose one value of this character in list and hobnobbing with the x and y.

    If anyone has a resolution please let me know.

    Thanks in advance!

    Video-based, precision is not a very big concern. If this is true, random points generation is not a big problem if loop you through the number of bats and generate random points based on the position and the dimensions of the tree.

    In addition, beats being a class, I think it's more effective to have a public property, for example, landingPoint:Point in this category - that way you can read out of each instance of bat when you browse the bats to find hitTarget.

    For example, if the class name is Bat and treeis the name of the graph of the tree:

    var numBats:int = 100;var bats:Array = [];var bat:Bat;for(var i:int = 0; i < numBats; i++) {     bat = new Bat();     bat.landingPoint = new Point(tree.x + Math.random() * tree.width, tree.y + Math.random() * tree.height);     bats.push(bat);}
    

    But if the accuracy is a concern, one of the ways would be to make the tree BitmapData and read (getPixel32() or getPixel()) pixels that are not transparent (or have some color) in a table, then random thing to do with bats based on this table of non-transparent pixels. The following code can work - he draws the bitmapdata without transparency, so converts the transparent pixels in black color and reads only the pixels that are not black. There may be bugs but it is for you to understand.

    var treeBMD:BitmapData = new BitmapData(tree.width, tree.height, false, 0x000000);treeBMD.draw(tree);var h:int = 0;for (var w:int = 0; w < tree.width; w++) {     for (h = 0; h < tree.height; h++) {          if (treeBMD.getPixel(w, y) > 0x000000) {               bat.landingPoint = new Point(w, h);          }     }}
    

    Post edited by: Andrei1

  • Help lead CC, unwanted objects on the scenes to succeed

    Hi all, super noob here is so desperately need help.

    I create a drag and drop for a project, but some items are report to the next scene when they are not on the timeline. I have a drag and drop on stage 8 announcement that carry the items to the next scene in their positions 'falling '.

    ActionScript here. Help would be GREAT appreciated!

    var orig1X:Number = Object1_mc.x;

    var orig1Y:Number = Object1_mc.y;

    var orig2X:Number = Object2_mc.x;

    var orig2Y:Number = Object2_mc.y;

    var orig3X:Number = Object3_mc.x;

    var orig3Y:Number = Object3_mc.y;

    var orig4X:Number = Object4_mc.x;

    var orig4Y:Number = Object4_mc.y;

    var orig5X:Number = Object5_mc.x;

    var orig5Y:Number = Object5_mc.y;

    Object1_mc.addEventListener (MouseEvent.MOUSE_DOWN, dragTheObject);

    Object1_mc.addEventListener (MouseEvent.MOUSE_UP, item1Release);

    Object2_mc.addEventListener (MouseEvent.MOUSE_DOWN, dragTheObject);

    Object2_mc.addEventListener (MouseEvent.MOUSE_UP, item2Release);

    Object3_mc.addEventListener (MouseEvent.MOUSE_DOWN, dragTheObject);

    Object3_mc.addEventListener (MouseEvent.MOUSE_UP, item3Release);

    Object4_mc.addEventListener (MouseEvent.MOUSE_DOWN, dragTheObject);

    Object4_mc.addEventListener (MouseEvent.MOUSE_UP, item4Release);

    Object5_mc.addEventListener (MouseEvent.MOUSE_DOWN, dragTheObject);

    Object5_mc.addEventListener (MouseEvent.MOUSE_UP, item5Release);

    function dragTheObject(event:MouseEvent):void {}

    var item: MovieClip = MovieClip (event.target);

    item.startDrag ();

    var topPos:uint = this.numChildren - 1;

    this.setChildIndex (item, topPos);

    }

    function item1Release(event:MouseEvent):void {}

    var item: MovieClip = MovieClip (event.target);

    item.stopDrag ();

    If (TargetObject1_mc.hitTestPoint (item.x, item.y)) {}

    Item.x = TargetObject1_mc.x;

    Item.y = TargetObject1_mc.y;

    } else {}

    Item.x = orig1X;

    Item.y = orig1Y;

    }

    };

    function item2Release(event:MouseEvent):void {}

    var item: MovieClip = MovieClip (event.target);

    item.stopDrag ();

    If (TargetObject2_mc.hitTestPoint (item.x, item.y)) {}

    Item.x = TargetObject2_mc.x;

    Item.y = TargetObject2_mc.y;

    } else {}

    Item.x = orig2X;

    Item.y = orig2Y;

    }

    };

    function item3Release(event:MouseEvent):void {}

    var item: MovieClip = MovieClip (event.target);

    item.stopDrag ();

    If (TargetObject3_mc.hitTestPoint (item.x, item.y)) {}

    Item.x = TargetObject3_mc.x;

    Item.y = TargetObject3_mc.y;

    } else {}

    Item.x = orig3X;

    Item.y = orig3Y;

    }

    };

    function item4Release(event:MouseEvent):void {}

    var item: MovieClip = MovieClip (event.target);

    item.stopDrag ();

    If (TargetObject4_mc.hitTestPoint (item.x, item.y)) {}

    Item.x = TargetObject4_mc.x;

    Item.y = TargetObject4_mc.y;

    } else {}

    Item.x = orig4X;

    Item.y = orig4Y;

    }

    };

    function item5Release(event:MouseEvent):void {}

    var item: MovieClip = MovieClip (event.target);

    item.stopDrag ();

    If (TargetObject5_mc.hitTestPoint (item.x, item.y)) {}

    Item.x = TargetObject5_mc.x;

    Item.y = TargetObject5_mc.y;

    } else {}

    Item.x = orig5X;

    Item.y = orig5Y;

    }

    };

    function reset(event:MouseEvent):void {}

    Object1_mc.x = orig1X;

    Object1_mc.y = orig1Y;

    Object2_mc.x = orig2X;

    Object2_mc.y = orig2Y;

    Object3_mc.x = orig3X;

    Object3_mc.y = orig3Y;

    Object4_mc.x = orig4X;

    Object4_mc.y = orig4Y;

    Object5_mc.x = orig5X;

    Object5_mc.y = orig5Y;

    }

    Reset_btn1.addEventListener (MouseEvent.CLICK, reset);

    Object1_mc.buttonMode = true;

    Object2_mc.buttonMode = true;

    Object3_mc.buttonMode = true;

    Object4_mc.buttonMode = true;

    Object5_mc.buttonMode = true;

    button_12.addEventListener (MouseEvent.CLICK, fl_ClickToGoToPreviousScene_7);

    function fl_ClickToGoToPreviousScene_7(event:MouseEvent):void

    {

    MovieClip (this.root) .prevScene ();

    }

    movieClip_13.addEventListener (MouseEvent.CLICK, fl_ClickToGoToNextScene_15);

    function fl_ClickToGoToNextScene_15(event:MouseEvent):void

    {

    MovieClip (this.root) .nextScene ();

    }

    After much messing around and back it seemed just to work!

    Everything I've done has been in addChild for 5 objects and then add removeChild to these same objects for the buttons 'next' and 'previous' of the scene. I swear I tried several times before, but it does not validate. Thanks for all help here.

  • Hi help me with drag and drop with as3 if you please

    Hello friends,

    I am a newbie to as3 in flash and had a prob with drag and drop features

    var dragArray:Array = [square_word, circle_word, triangle_word];

    var matchArray:Array = [squareMatch, circleMatch, triangleMatch];

    var posArray:Array = [{x: 276, y: 207}, {x: 443, y: 207}, {x: 107, y: 207}];

    var currentClip:MovieClip;

    var startX:Number;

    var startY: number;

    for (var i: int = 0; i < dragArray.length; i ++) {}

    dragArray [i] .buttonMode = true;

    dragArray [i] .addEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);

    matchArray [i] .alpha = 0.2;

    }

    function item_onMouseDown(event:MouseEvent):void {}

    currentClip = MovieClip (event.currentTarget);

    startX = currentClip.x;

    startY = currentClip.y;

    addChild (currentClip); bring to front

    currentClip.startDrag ();

    stage.addEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);

    }

    function stage_onMouseUp(event:MouseEvent):void {}

    stage.removeEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);

    currentClip.stopDrag ();

    var int index = dragArray.indexOf (currentClip);

    var matchClip:MovieClip = MovieClip (matchArray [index]);

    If (matchClip.hitTestPoint (currentClip.x, currentClip.y, true)) {}

    a match was found. Position the clip using the values of posArray:

    currentClip.x = posArray [index] .x;

    currentClip.y = there posArray [index];

    make not draggable:

    currentClip.removeEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);

    currentClip.buttonMode = false;

    } else {}

    football match has not, so send the clip to the back where he began:

    currentClip.x = startX;

    currentClip.y = startY;

    }

    in this code, that I'm not the subject abruptly to its original position if he fell into a movieclip wrong (as we should have the availability of droping the drag square circle alse object) and then we should have a button to check if everything is correctly matched, if not after clicking another button 'correctitself', we should get the good objects droping on correct locations automatically

    Please help with any suggestions ASAP

    }

    assign your listener matchall checkAllMatchF and use button:

    var dragArray:Array = [square_word, circle_word, triangle_word];

    var matchArray:Array = [squareMatch, circleMatch, triangleMatch];

    var posArray:Array = [{x: 276, y: 207}, {x: 443, y: 207}, {x: 107, y: 207}];

    var currentClip:MovieClip;

    var startX:Number;

    var startY: number;

    for (var i: int = 0; i< dragarray.length;="" i++)="">

    dragArray [i] .buttonMode = true;

    dragArray [i] .addEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);

    matchArray [i] .alpha = 0.2;

    }

    function item_onMouseDown(event:MouseEvent):void {}

    currentClip = MovieClip (event.currentTarget);

    startX = currentClip.x;

    startY = currentClip.y;

    addChild (currentClip); bring to front

    currentClip.startDrag ();

    stage.addEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);

    }

    function stage_onMouseUp(event:MouseEvent):void {}

    stage.removeEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);

    currentClip.stopDrag ();

    var int index = dragArray.indexOf (currentClip);

    var matchClip:MovieClip = MovieClip (matchArray [index]);

    If (matchClip.hitTestPoint (currentClip.x, currentClip.y, true)) {}

    a match was found. Position the clip using the values of posArray:

    currentClip.x = posArray [index] .x;

    currentClip.y = there posArray [index];

    make not draggable:

    currentClip.removeEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);

    currentClip.buttonMode = false;

    } else {}

    football match has not, so send the clip to the back where he began:

    currentClip.x = startX;

    currentClip.y = startY;

    }

    }

    function checkAllMatchF (): Boolean {}

    for (var i: int = 0; i<>

    If (dragArray [i] .x! = matchArray [i] .x | dragArray [i] there! = matchArray [i] there) {}

    Returns false;

    }

    }

    Returns true;

    }

  • Need help with virtual shelf - drag and drop between components?

    Hello

    Im trying to create a virtual shelf, where book spines are clips of individual video that can be dragged and re-ordered on the set.  For the moment I can drag the thorns to a target affected, but not just any target or "nudge" the position of other books along.

    I'm sorry that if that's a little vague I'm not experienced in as3, please do not hesitate to ask any questions and I'll do my best to answer.  IM thinking that a table is necessary which occupies the posts, but I'm not sure how to put it all together!

    Any help is greatly appreciated! The code I have so far is:

    import flash.events.MouseEvent;
    import flash.display.MovieClip;

    var dragArray:Array = [red, blue, green, purple, yellow];
    var matchArray:Array is [target1, target2, target3, target4, target5];.

    var currentClip:MovieClip;
    var startX:Number;
    var startY: number;

    for (var i: int = 0; i < dragArray.length; i ++) {}
    dragArray [i] .buttonMode = true;
    dragArray [i] .addEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);
    matchArray [i] .alpha = 0.2;
    }

    function item_onMouseDown(event:MouseEvent):void {}
    currentClip = MovieClip (event.currentTarget);
    startX = currentClip.x;
    startY = currentClip.y;
    addChild (currentClip); bring to front
    currentClip.startDrag ();
    stage.addEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);
    }

    function stage_onMouseUp(event:MouseEvent):void {}
    stage.removeEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);
    currentClip.stopDrag ();
    var int index = dragArray.indexOf (currentClip);
    var matchClip:MovieClip = MovieClip (matchArray [index]);
    If (matchClip.hitTestPoint (currentClip.x, currentClip.y, true)) {}
    a match was found. Position the clip on the corresponding clip:
    currentClip.x = matchClip.x;
    currentClip.y = matchClip.y;
    make not draggable:
    currentClip.removeEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);
    currentClip.buttonMode = false;
    } else {}
    football match has not, so send the clip to the back where he began:
    currentClip.x = startX;
    currentClip.y = startY;
    }
    }

    Yes, you can double click on activate your movieclips and assign the function double click listeners who use navigateToURL

    dragArray [0] .doubleClickEnabled = true;

    dragArray [0] .addEventListener (MouseEvent.DOUBLE_CLICK, f);

    function f(e:Event):void {}

    navigateToURL (new URLRequest ("http://www.adobe.com"));

    }

  • TIMER PROBLEM! Help, please! AS3

    I have this drag and drop shape game... I have this again "try" button Reset the timer, the score and the location of movable forms and «start' button that starts the timer and like «10,9,8,7...» until she paid 0 and "try again" and "next" button will appear... my main problem is, whenever I have click the "try" button again, and then click 'Start'... my timer increment decrement State... first he "10,9,8,7.." then when I click on try again and click Start Timer will '10,8,6,4... '. then when I click on try again and again it goes "10,7,4.." would you help me on this... I want this decrement, only 1 number at the same time I have click on try twice the key... Thanks in advance

    Stop();

    import flash.events.KeyboardEvent;

    import flash.utils.Timer;

    import flash.events.MouseEvent;

    var countDownIncShapes:Number = 1;

    var totalSecsShapes = 10;

    var countDownSecsShapes = totalSecsShapes;

    var score_Shapes:int = 0;

    next14. Visible = false;

    tryAgain14.visible = false;

    var timeShapes:Timer = new Timer(countDownIncShapes*1000);

    var dragArrayShapes:Array = [square14, triangle14, circle14, rectangle14];

    var matchArrayShapes:Array = [tv, pyramid, ball, envelope];

    var posArrayShapes:Array = [{x: 1113.7, y: 205.90}, {x: 812, y: 205.90}, {x: 207.55, y: 205.90}, {x: 506.25, y: 205.90}];

    var currentClipShapes:MovieClip;

    var Shapes_startX:Number;

    var Shapes_startY:Number;

    Start_Shapes.addEventListener (MouseEvent.CLICK, startShapesdrag);

    function startShapesdrag(e:MouseEvent):void

    {

    timeShapes.start ();

    timeShapes.addEventListener (TimerEvent.TIMER, tickShapes);

    function tickShapes (e:TimerEvent): void

    {

    If (counterShapes.text is "0")

    {

    timeShapes.stop ();

    countDownSecsShapes = totalSecsShapes;

    circle14.buttonMode = false;

    square14.buttonMode = false;

    triangle14.buttonMode = false;

    rectangle14.buttonMode = false;

    circle14. RemoveEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    square14. RemoveEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    triangle14. RemoveEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    rectangle14. RemoveEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    If (scoreShapes.text > = "300")

    {

    next14. Visible = true;

    tryAgain14.visible = true;

    tryAgain14.addEventListener (MouseEvent.MOUSE_DOWN, tryAgain14_onMouseDown);

    next14.addEventListener (MouseEvent.MOUSE_DOWN, next14_onMouseDown);

    }

    If (scoreShapes.text < "300")

    {

    tryAgain14.visible = true;

    tryAgain14.addEventListener (MouseEvent.MOUSE_DOWN, tryAgain14_onMouseDown);

    }

    }

    on the other

    {

    countDownSecsShapes = countDownSecsShapes - 1;

    counterShapes.text = countDownSecsShapes;

    circle14.buttonMode = true;

    square14.buttonMode = true;

    triangle14.buttonMode = true;

    rectangle14.buttonMode = true;

    trylang.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    circle14.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    square14.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    triangle14.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    rectangle14.addEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    }

    }

    }

    function shapesItem_onMouseDown(event:MouseEvent):void

    {

    currentClipShapes = MovieClip (event.currentTarget);

    Shapes_startX = currentClipShapes.x;

    Shapes_startY = currentClipShapes.y;

    addChild (currentClipShapes);

    currentClipShapes.startDrag ();

    stage.addEventListener (MouseEvent.MOUSE_UP, shapesStage_onMouseUp);

    }

    function shapesStage_onMouseUp(event:MouseEvent):void

    {

    stage.removeEventListener (MouseEvent.MOUSE_UP, shapesStage_onMouseUp);

    currentClipShapes.stopDrag ();

    var indexShapes:int = dragArrayShapes.indexOf (currentClipShapes);

    var matchClipShapes:MovieClip = MovieClip (matchArrayShapes [indexShapes]);

    If (matchClipShapes.hitTestPoint (currentClipShapes.x, currentClipShapes.y, true))

    {

    currentClipShapes.x = posArrayShapes [indexShapes] .x;

    currentClipShapes.y = posArrayShapes [indexShapes] there;

    currentClipShapes.removeEventListener (MouseEvent.MOUSE_DOWN, shapesItem_onMouseDown);

    currentClipShapes.buttonMode = false;

    score_Shapes is score_Shapes = 100;.

    scoreShapes.text = score_Shapes.toString ();

    }

    on the other

    {

    currentClipShapes.x = Shapes_startX;

    currentClipShapes.y = Shapes_startY;

    }

    }

    function next14_onMouseDown(e:MouseEvent):void

    {

    gotoAndPlay (15);

    }

    function tryAgain14_onMouseDown(e:MouseEvent):void

    {

    square14.x = 1110.15;

    square14.y = 533.75;

    circle14.x = 227,05;

    circle14.y = 541,3;

    triangle14.x = 818.85;

    triangle14.y = 537;

    rectangle14.x = 506.30.

    rectangle14.y = 529.85;

    score_Shapes = 0;

    scoreShapes.text = "";

    counterShapes.text = countDownSecsShapes;

    tryAgain14.visible = false;

    next14. Visible = false;

    timeShapes.reset ();

    Start_Shapes.addEventListener (MouseEvent.CLICK, startShapesdrag);

    }

    If you are out of the frame that contains the button of your Start_Shapes you will need to add this listener each time you come back on the frame with _Start_Shapes.

    Thus, it may be your timer listener that is causing the problem.  and when I checked I see a known problem: you're nesting functions named.  never do this:

    function startShapesdrag(e:MouseEvent):void

    {

    timeShapes.start ();

    timeShapes.addEventListener (TimerEvent.TIMER, tickShapes);

    function tickShapes (e:TimerEvent): void

    {

    .

    .

    .

    }

    }

    should be

    function startShapesdrag(e:MouseEvent):void

    {

    {if (! timeShapes.hasEventListener (TimerEvent.Timer))}

    timeShapes.addEventListener (TimerEvent.TIMER, tickShapes);

    }

    timeShapes.start ();

    }

    function tickShapes (e:TimerEvent): void

    {

    .

    .

    .

    }

  • hitTestPoint do not recognize the full form

    Hey guys, thanks for helping them.  Someone knows why would hit "hitTestPoint (character.x, character, true) ' trial about to origin in the center of the character and not the entire shape?

    This is my code in my document class.  There is a custom class splat in there, but don't worry about this.  This code is inside the 2(1 nested) for loops.

    function hitTestBalls(e:Event) {}

    for (var i = ballArray.length - 1; i > = 0; i--) {}

    for (var m = MonsterArray.length - 1; m > = 0; m-) {}

    If ((ballArray [i].hitTestPoint (MonsterArray [m].x,.y MonsterArray [m], true)) & & (MonsterArray [m].) MouthClosed == true)) {}

    trace ("219");

    var splat: Splat = new Splat(ballArray[i].currentFrame*10,ballArray[i].x,ballArray[i].y);

    addChild (splat);

    }

    If (ballArray [i] .hitTestObject ([m] MonsterArray. HitTester) | ballArray [i] .x > stage.stageWidth | ballArray [i] there > 420) {}

    trace ("217");

    If (ballArray [i] there > 420) {}

    var splat2:Splat = new Splat(ballArray[i].currentFrame*10,ballArray[i].x,ballArray[i].y);

    addChild (splat2);

    }

    ballArray [i].updateTimer.stop ();

    ballArray [i] .updateTimer = null;

    ballArray [i].parent.removeChild (ballArray [i]);

    ballArray.splice (i, 1);

    }

    }

    }

    updateScore();

    }

    "hitTestPoint (character.x, character, true) ' tries against the registration of character point which can be located anywhere according to your configuration.  the reg point could be anywhere near all the pixels you see that the form of the character.

  • help place objects, make sure that they do not have more tour

    Hey guys, really happy with the little program that I made. Learned a lot over the past months with the help of the community. I have all the features I want. The basic principle of this exercise is that the youth will enter a statement, drag on a microphone and it will appear on the corresponding box (board1, selection2, Canada3). So if they seize two statements in a row he will place their responses to my predetermined location. Is it possible to space out each answer by a difference of 10 px? So they enter one answer and it will go to the (x) 75px, answer two will go to x 85 px? Basically, ensuring that mc does not overlap or accumulate. Hope it makes sense. My code is below, with the highlighted area.

    listeners

    backbutton.addEventListener (MouseEvent.CLICK, Precedentcliquez);

    helpbutton.addEventListener (MouseEvent.CLICK, helpclick);

    answerbutton.addEventListener (MouseEvent.CLICK, answerclick);

    helpmenu.xbutton.addEventListener (MouseEvent.CLICK, xbuttonclick);

    answermenu.xanswerbutton.addEventListener (MouseEvent.CLICK, xanswerbuttonclick);

    stage.addEventListener (Event.ENTER_FRAME, _fullScreen);

    for (var i: int = 1; i < = 11; i ++) {}

    This ["realgtext" + i] .addEventListener (MouseEvent.MOUSE_DOWN, grabMe);

    }

    for (i = 1; i < = 12; i ++) {}

    This ["windows" + i] .addEventListener (MouseEvent.MOUSE_DOWN, grabMe);

    }

    Import fl.transitions.Tween;

    Fl.transitions.easing import. *;

    Import fl.transitions.TweenEvent;

    import com.greensock;

    import flash.media.Sound;

    import flash.display.StageScaleMode;

    import flash.events.Event;

    import flash.display.StageDisplayState;

    HelpMenu.Visible = false;

    answermenu. Visible = false;

    variable declarations

    var folderclicksound:paperflip = new paperflip

    var mainclicksound:mainclick = new mainclick

    var I: Object;

    function grabMe(e:MouseEvent):void {}

    = me e.currentTarget;

    me.removeEventListener (MouseEvent.MOUSE_DOWN, grabMe);

    me.startDrag (true);

    addChild (e.currentTarget as DisplayObject);

    stage.addEventListener (MouseEvent.MOUSE_MOVE, Drachma);

    stage.addEventListener (MouseEvent.MOUSE_UP, dropMe);

    }

    function dropMe(e:MouseEvent):void {}

    stage.removeEventListener (MouseEvent.MOUSE_UP, dropMe);

    stage.removeEventListener (MouseEvent.MOUSE_MOVE, Drachma);

    me.stopDrag ();

    me.addEventListener (MouseEvent.MOUSE_DOWN, grabMe);

    droponmic (DisplayObject (e.currentTarget))

    / / mainclicksound.play ();

    }

    function dragMe(e:MouseEvent):void {}

    e.updateAfterEvent ();

    dragchange (DisplayObject (e.currentTarget))

    }

    function dragchange(e:DisplayObject):void {}

    If (paper.hitTestPoint (mouseX, mouseY, true)) {}

    me.gotoAndStop ("lyric")

    TweenMax.to(me,1,{scaleX:0.6,scaleY:0.6,rotation:0});)

    } else if (micfeelings.hitTestPoint (mouseX, mouseY, true)) {}

    me.gotoAndStop ("cat")

    TweenMax.to(me,0.75,{scaleX:0.29,scaleY:0.29,rotation:0});)

    } else if (micactions.hitTestPoint (mouseX, mouseY, true)) {}

    me.gotoAndStop ("cat")

    TweenMax.to(me,0.75,{scaleX:0.29,scaleY:0.29,rotation:0});)

    } else if (micthoughts.hitTestPoint (mouseX, mouseY, true)) {}

    me.gotoAndStop ("cat")

    TweenMax.to(me,0.75,{scaleX:0.29,scaleY:0.29,rotation:0});)

    } else {}

    me.gotoAndStop ("air")

    TweenMax.to(me,0.2,{scaleX:0.8,scaleY:0.8,rotation:0});)

    }

    }

    function droponmic(e:DisplayObject):void {}

    If (micactions.hitTestPoint (mouseX, mouseY, true)) {}

    TweenMax.to(me,0.75,{scaleX:0.35,scaleY:0.35,rotation:0});)

    me.x = 500

    me.y = 273

    section 2

    } else if (micthoughts.hitTestPoint (mouseX, mouseY, true)) {}

    TweenMax.to(me,0.75,{scaleX:0.35,scaleY:0.35,rotation:0});)

    me.x = 800

    me.y = 273

    section 3

    } else if (micfeelings.hitTestPoint (mouseX, mouseY, true)) {}

    TweenMax.to(me,0.75,{scaleX:0.35,scaleY:0.35,rotation:0});)

    me.x = 200

    me.y = 75

    }

    }

    function _fullScreen(e:Event):void

    {

    stage.removeEventListener (Event.ENTER_FRAME, _fullScreen);

    stage.scaleMode = StageScaleMode.EXACT_FIT;

    stage.displayState = StageDisplayState.FULL_SCREEN;

    }

    items in NAV bar

    function backclick(event:MouseEvent):void {}

    answermenu.visible = false;

    helpmenu.visible = false;

    }

    function helpclick(event:MouseEvent):void {}

    helpmenu.visible = true;

    answermenu.visible = false;

    setChildIndex (WorldShip, numChildren - 1).

    TweenMax.to (our help, 3, {y: 350, startAt: {y: 600}, ease:Elastic.easeOut});})

    }

    function xbuttonclick(event:MouseEvent):void {}

    helpmenu.visible = false;

    }

    function answerclick(event:MouseEvent):void {}

    answermenu.visible = true;

    helpmenu.visible = false;

    setChildIndex (answermenu, numChildren - 1).

    TweenMax.to (answermenu, 3, {y: 350, startAt: {y: 600}, ease:Elastic.easeOut});})

    }

    function xanswerbuttonclick(event:MouseEvent):void {}

    answermenu.visible = false;

    helpmenu.visible = false;

    }

    //}

    sound components

    function mainclicksoundplay (): void {}

    mainclicksound. Play();

    //}

    use:

    var nextX:int = 75;

    listeners

    backbutton.addEventListener (MouseEvent.CLICK, Precedentcliquez);

    helpbutton.addEventListener (MouseEvent.CLICK, helpclick);

    answerbutton.addEventListener (MouseEvent.CLICK, answerclick);

    helpmenu.xbutton.addEventListener (MouseEvent.CLICK, xbuttonclick);

    answermenu.xanswerbutton.addEventListener (MouseEvent.CLICK, xanswerbuttonclick);

    stage.addEventListener (Event.ENTER_FRAME, _fullScreen);

    for (var i: int = 1; i<>

    This ["realgtext" + i] .addEventListener (MouseEvent.MOUSE_DOWN, grabMe);

    }

    for (i = 1; i<>

    This ["windows" + i] .addEventListener (MouseEvent.MOUSE_DOWN, grabMe);

    }

    Import fl.transitions.Tween;

    Fl.transitions.easing import. *;

    Import fl.transitions.TweenEvent;

    import com.greensock;

    import flash.media.Sound;

    import flash.display.StageScaleMode;

    import flash.events.Event;

    import flash.display.StageDisplayState;

    HelpMenu.Visible = false;

    answermenu. Visible = false;

    variable declarations

    var folderclicksound:paperflip = new paperflip

    var mainclicksound:mainclick = new mainclick

    var I: Object;

    function grabMe(e:MouseEvent):void {}

    = me e.currentTarget;

    me.removeEventListener (MouseEvent.MOUSE_DOWN, grabMe);

    me.startDrag (true);

    addChild (e.currentTarget as DisplayObject);

    stage.addEventListener (MouseEvent.MOUSE_MOVE, Drachma);

    stage.addEventListener (MouseEvent.MOUSE_UP, dropMe);

    }

    function dropMe(e:MouseEvent):void {}

    stage.removeEventListener (MouseEvent.MOUSE_UP, dropMe);

    stage.removeEventListener (MouseEvent.MOUSE_MOVE, Drachma);

    me.stopDrag ();

    me.addEventListener (MouseEvent.MOUSE_DOWN, grabMe);

    droponmic (DisplayObject (e.currentTarget))

    mainclicksound. Play();

    }

    function dragMe(e:MouseEvent):void {}

    e.updateAfterEvent ();

    dragchange (DisplayObject (e.currentTarget))

    }

    function dragchange(e:DisplayObject):void {}

    If (paper.hitTestPoint (mouseX, mouseY, true)) {}

    me.gotoAndStop ("lyric")

    TweenMax.to(me,1,{scaleX:0.6,scaleY:0.6,rotation:0});)

    } else if (micfeelings.hitTestPoint (mouseX, mouseY, true)) {}

    me.gotoAndStop ("cat")

    TweenMax.to(me,0.75,{scaleX:0.29,scaleY:0.29,rotation:0});)

    } else if (micactions.hitTestPoint (mouseX, mouseY, true)) {}

    me.gotoAndStop ("cat")

    TweenMax.to(me,0.75,{scaleX:0.29,scaleY:0.29,rotation:0});)

    } else if (micthoughts.hitTestPoint (mouseX, mouseY, true)) {}

    me.gotoAndStop ("cat")

    TweenMax.to(me,0.75,{scaleX:0.29,scaleY:0.29,rotation:0});)

    } else {}

    me.gotoAndStop ("air")

    TweenMax.to(me,0.2,{scaleX:0.8,scaleY:0.8,rotation:0});)

    }

    }

    function droponmic(e:DisplayObject):void {}

    If (micactions.hitTestPoint (mouseX, mouseY, true)) {}

    TweenMax.to(me,0.75,{scaleX:0.35,scaleY:0.35,rotation:0});)

    me.y = 273

    section 2

    } else if (micthoughts.hitTestPoint (mouseX, mouseY, true)) {}

    TweenMax.to(me,0.75,{scaleX:0.35,scaleY:0.35,rotation:0});)

    me.y = 273

    section 3

    } else if (micfeelings.hitTestPoint (mouseX, mouseY, true)) {}

    TweenMax.to(me,0.75,{scaleX:0.35,scaleY:0.35,rotation:0});)

    me.y = 75

    }

    me .x = nextX;

    nextX += 10;

    }

    function _fullScreen(e:Event):void

    {

    stage.removeEventListener (Event.ENTER_FRAME, _fullScreen);

    stage.scaleMode = StageScaleMode.EXACT_FIT;

    stage.displayState = StageDisplayState.FULL_SCREEN;

    }

    items in NAV bar

    function backclick(event:MouseEvent):void {}

    answermenu. Visible = false;

    HelpMenu.Visible = false;

    }

    function helpclick(event:MouseEvent):void {}

    HelpMenu.Visible = true;

    answermenu. Visible = false;

    setChildIndex (WorldShip, numChildren - 1).

    TweenMax.to (our help, 3, {y: 350, startAt: {y: 600}, ease:Elastic.easeOut});})

    }

    function xbuttonclick(event:MouseEvent):void {}

    HelpMenu.Visible = false;

    }

    function answerclick(event:MouseEvent):void {}

    answermenu. Visible = true;

    HelpMenu.Visible = false;

    setChildIndex (answermenu, numChildren - 1).

    TweenMax.to (answermenu, 3, {y: 350, startAt: {y: 600}, ease:Elastic.easeOut});})

    }

    function xanswerbuttonclick(event:MouseEvent):void {}

    answermenu. Visible = false;

    HelpMenu.Visible = false;

    }

    //}

    sound components

    function mainclicksoundplay (): void {}

    mainclicksound. Play();

    //}

  • hitTestPoint to change direction of moving object

    I'm having a problem of changing the direction of a clip using hitTestPoint. I've got some balls on the screen who doesn't move left, right, up and down. and waiting for the way they move they must change direction. If they move right they have to change to a maximum.  left to the bottom right and left. I tried the following code to get a mobile ball right to change to a maximum of travel.

    Note: movingDir is just a string that I use to keep track of how the ball is moving and is initially set to another class.

    Here is an excerpt of the ball class:

    this._movingDir = "right";
    this._speedR = 5;
    this.x += this._speedR; 
    
    

    public function hittingRebounder(e:Event):void {
                for(var c:uint = 0; c < Ball.ballsArray.length; c++){
                    if(Ball.ballsArray[c].hitTestPoint(this.x, this.y)){
                        if(Ball.ballsArray[c]._movingDir == "right"){
                            trace("right");
                            upMoving.push(Ball.ballsArray[c]);
                            Ball.ballsArray[c].addEventListener(Event.ENTER_FRAME, greenPo****U);
                        }
                        else if(Ball.ballsArray[c]._movingDir == "left"){
                            trace("left");
                        }
                        else if(Ball.ballsArray[c]._movingDir == "up"){
                            trace("up");
                        }
                        else if(Ball.ballsArray[c]._movingDir == "down"){
                            trace("down");
                        }
                    }
                }
            }
    
    public function greenPo****U(e:Event):void {
                for(var g:uint = 0; g < upMoving.length; g++){
                    
                    upMoving[g]._movingDir = "up"
                    upMoving[g]._speedR = 0;
                    upMoving[g]._speedU = 5;
                    upMoving[g].y -= upMoving[g]._speedU;
                }
                
            }
    

    Help would be very appreciated. Thank you.

    What I mean is that your ball class will be on each moving balls.  He would boil up to something like the following...

    package {}
        
    import flash.display.MovieClip;
    import flash.events.Event;
        
        
    SerializableAttribute public class ball extends MovieClip {}
             
    public var _startX:uint;
    public var _startY:uint;
    public var _movingDir:String;
    public var _speedU:uint;
    public var _speedR:uint;
             
    public void Ball() {}
    the constructor code
    this.addEventListener (Event.ENTER_FRAME, ballMove);
    This ._startX = this.x;
    This ._startY = this.y;
    }
             
    public void ballMove(e:Event):void {}
    {if (Start.isStartPressed)}
    This.y += this ._speedU;
    This.x += this ._speedR;
    } else {}
    This.x = _startX;
    This.y = _startY;
    }
    }
    }
    }

    The ball class doesn't have a table... it's just a balloon.  The range of balls would be something that is managed by a different process, something which oversees all the balls.  It could be your other package (since it deals with all the balls), or it could be another package.  But here's what I intended as far as the other class goes...

    package {}

    import flash.events.Event;
    import flash.display.MovieClip;
        
    SerializableAttribute public class PosRebounder extends MovieClip {}
             
    public static var isRebounderHit:Boolean = false;
    public static var ballsArray:Array = []; you need to fill in this table
             
    public void PosRebounder() {}
    the constructor code
    this.addEventListener (Event.ENTER_FRAME, hittingRebounderElect);
    }
             
    public void hittingRebounderElect(e:Event):void {}
               
    for (var i: uint = 0; i
    If (ballsArray [i] .hitTestPoint (this.x, this.y)) {}
    If (ballsArray [i] ._movingDir == "right") {}
    ._movingDir ballsArray [i] = "rise."
    ._speedU ballsArray [i] = - 5;
    ._speedR ballsArray [i] = 0;
    } ElseIf (._movingDir Ball.ballsArray [i] == "left") {}
    ._movingDir ballsArray [i] = "down".
    ._speedU ballsArray [i] = 5;
    ._speedR ballsArray [i] = 0;
    } ElseIf (._movingDir Ball.ballsArray [i] == "up") {}
    ballsArray [i] ._movingDir = 'left ';
    ._speedU ballsArray [i] = 0;
    ._speedR ballsArray [i] = - 5;
    } ElseIf (._movingDir Ball.ballsArray [i] == "down") {}
    ._movingDir ballsArray [i] = 'right ';
    ._speedU ballsArray [i] = 0;
    ._speedR ballsArray [i] = 5;
    }
    }
    }
    }
    }
    }

    The code above is not intended to be plugged in and tested since the balls themselves are not defined in it and the initial positions of them aren't, nor their initial sense.  But that again is something that could be handled by a function of oversees who treats all the balls... maybe another function in the second class, shown above.

  • Error #1009 in my platform game! Help, please!

    My game of base platform that I have a "hero" who can walk and jump on the 'ground '. There is also a door to the next scene, which is the next level. The first scene works very well, but "TypeError: Error #1006: value is not a function." to Charles3_fla::MainTimeline/frame1()"appears once in the output. This works however, and I'm not worried about it. The second, I'm going through the door but, scene 2 opens, and then starts flashing as "TypeError: Error #1009: cannot access a property or method of a null object reference." to Charles3_fla::MainTimeline/onenter()"appears a LOT in the output. I don't know how to solve this problem and I would like to help. P.S. I use Adobe CS5 with actionscript 3

    Here is the code for stage 1:

    hero.gotoAndStop ('still');

    var key: KeyObject = new KeyObject (internship);

    var vy:Number = 0;

    var gravity: number = 2;

    var jumped: Boolean = false;

    stage.addEventListener (Event.ENTER_FRAME, onenter) (true);

    function onenter(e:Event):void {}

    Vy += gravity;

    If (! ground.hitTestPoint (hero.x, hero.y, true)) {}
    Hero.y + vy;
    }
    If(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {}
    Hero.x-= 13;
    }
    If(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {}
    Hero.x += 13;
    }

    If (vy > 10) {}
    Vy = 10;
    }
    for (var i: int = 0; i < 10; i ++) {}
    If (ground.hitTestPoint (hero.x, hero.y, true)) {}
    Hero.y-;
    Vy = 6;
    jumped = true;
    }
    }
    {if (Door.hitTestObject (Hero))}
    gotoAndPlay (1, "scene 2");
    }
    if(Hero.y>300) {}

    Vy = 6;
    jumped = true;

    }

    If (Key.isDown (Key.up) & & jumped) {}

    Vy = - 13;
    jumping = false;

    }

    Hero.y += vy;

    {if (Key.isDown (Key.Right))}
    Hero.x += 10;
    hero.scaleX = 1;
    hero.gotoAndStop ('walking');
    } else {if (Key.isDown (Key.LEFT))
    Hero.x-= 10;
    hero.scaleX =-1;
    hero.gotoAndStop ('walking');
    } else {}
    hero.gotoAndStop ('still');

    }

    }

    And for scene 2...

    hero.gotoAndStop ('still');

    var Key1:KeyObject = KeyObject (internship);

    var vy1:Number = 0;

    var gravity1:Number = 2;

    var jumped1:Boolean = false;

    stage.addEventListener (Event.ENTER_FRAME, onenter1) (true);

    function onenter1(e:Event):void {}

    VY1 += gravity;

    If (! ground.hitTestPoint (hero.x, hero.y, true)) {}
    Hero.y + vy;
    }
    If(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {}
    Hero.x-= 13;
    }
    If(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {}
    Hero.x += 13;
    }

    If (vy1 > 10) {}
    VY1 = 10;
    }
    for (var i: int = 0; i < 10; i ++) {}
    If (ground.hitTestPoint (hero.x, hero.y, true)) {}
    Hero.y-;
    VY1 = 6;
    jumped1 = true;
    }
    }
    {if (Door.hitTestObject (Hero))}
    gotoAndPlay (1, "scene 2");
    }
    if(Hero.y>300) {}

    VY1 = 6;
    jumped1 = true;

    }

    If (Key.isDown (Key.up) & & jumped1) {}

    VY1 = - 13;
    jumped1 = false;

    }

    Hero.y += vy;

    {if (Key.isDown (Key.Right))}
    Hero.x += 10;
    hero.scaleX = 1;
    hero.gotoAndStop ('walking');
    } else {if (Key.isDown (Key.LEFT))
    Hero.x-= 10;
    hero.scaleX =-1;
    hero.gotoAndStop ('walking');
    } else {}
    hero.gotoAndStop ('still');

    }

    }

    Please answer as soon as possible and thank you for your time

    swiatekalex555

    the idea was to stop your main timeline to move forward because it was a problem that you mentioned in a previous message.

    Anyway, this thread has answered a long time ago and is now unrelated to error # 1009.  Please mark this thread as answered and start a new thread.

  • I have a lg 4 k tv (40 "40UH630V TV LG ULTRA HD 4 K) with HDMI 2. 0 and if I buy apple tv 4 can be used with HDMI 2. 0 port or do I HDMI 3 port to use this? Please help me

    I have a lg 4 k tv (40 "40UH630V TV LG ULTRA HD 4 K) with HDMI 2. 0 and if I buy apple tv 4 can be used with HDMI 2. 0 port or do I HDMI 3 port to use this? Please help me

    You can use it with your TV.

  • Need help to find an adapter for a third-party monitor

    Hi all! I find myself in need of a little guidance, and I hope that someone out there will have a quick n easy for me...

    I have a Mid-2011 27 'iMac. which has two ports Thunderbolt It is taken with a Wacom tablet that I use constantly, and the other is made by an external hard drive to a solid state, which has a built-in cable to Thunderbolt (no way to hang it on a different port). I also have a 27 "HP monitor that is currently connected via an HDMI USB adapter.

    The problem is that the HP monitor is actual "jiggy" - the USB does not seem fast enough to deal with requests for the monitor. It is almost unusable. I know I should run it via a HDMI adapter Thunderbolt, but as I have already mentioned the two my Thunderbolt ports are already in use.

    Someone at - it ideas? I need sort of three to two ports Thunderbolt hooks, but I can't seem to find anything for less than $300 that would work. (I am illiterate when it comes to the different cables, adapters, ports, etc., so I hope someone can point me in the right direction by using short words... Most of the products that I travel through list specifications that me Chicane).

    The monitor has two HDMIs and a VGA port, and my iMac has a Firewire 800 port, if that helps at all...

    2011 iMac have only 1 Thunderbolt port and there is no such thing as a Mid-2011, you must have an iMac of year later, if it has 2 ports Thunderbolt. All the 27 "iMacs, from 2012 to 2015 the current have 2 ports Thunderbolt.

  • Help with Safari!

    My macbook air from apple not to open the Web page like www.investing.com! Help! Different Web pages all okey, but it's not working!

    Works fine for me.

    What extension you have installed and activated?

    Do you have any adware installed on your MBA?

  • He can't change the region of my account! Help, please! Thank you ~ ~ ~

    Hello

    I want to change my account area. But I still balance ($0.02) so I couldn't change. Please delete my balance.

    Thank you!

    and now I can not contact the Apple Support it's always show

    We're sorry.

    We are unable to respond to your request at this time. Please try again or come back later.

    1c14bb55-ED82-4B43-9c22-fc79914a022c

    is could someone please help me contact the apple support to clear my balance or help me another way to change the region on my account please!

    Thank you!!

  • Sierra is a bomb, need help to return to El Capitan

    Could someone more at Apple just try it once to make sure that the "new and improved" operating systems actually work before releasing? With all the money goes to Cupertino, there is no money to hire testers rather than rely on Mac users? Talk about Stockholm syndrome. I'll cut to the Chase, now my computer has been upgraded to Sierra without my knowledge, and several apps are now, not to mention that I can't access my company's server today. How to return to El Capitan - can I save all my work from today and use Time Machine to restore my machine? If this isn't the case, should I really erase everything and start from scratch? Someone please stop me to jump on a ledge, I have work I need to pass on to customers. Any suggestions, help, you can give would be appreciated. Carl

    Restore your backup, and if you do not upgrade your Mac, who did? Maybe you should tell them not to do the without you knowledge or approval.

Maybe you are looking for

  • Satellite U300 - help hardware upgrade to SSD and RAM

    Hello worldI want to completely upgrade my toshiba satellite U300-140, mount VISTA and default the technical features, posted above. I need your help to choose the best (and economic) device SSD and RAM slot. It is very important for me to know what

  • I'm stuck on my account and I forgot the information Please Help!

    Microsoft it please help me my name is Sam, I've had my X - box live account for 3 years now and I took a friend's House and I wanted to sign on my account but the Windows live ID and password did not work. I went home and I wanted to put a password

  • Not able to connect to the account that was created today.

    Original title: I'm trying to sign yo one account I have set up only toda, IWROTE MY PASS WORD to the BOTTOM AND KNOW IT BY CŒUR WITHOUT, BUT I still said that it is incorrect I am trying to sign yo an account that I set up only toda, IWROTE MY PASS

  • Update Xperia Arc S problem

    My number IF is 1253 - 9246.Even but it's on update list I still cannot update my phone. I used the PC Companion and Service Update update method, but he says your mobile is always up to date. Also I did ' t received the message that says you have a

  • Cisco ASA delay listening to the output of the command

    Dear, I use ASA5520 active failover / standby... when connect us via the console or telnet and write the command ant 'show', it's very slow displaying output! Thank you Majed