ActionScript 3.0 :: StartDrag - StopDrag - HitTestObject - Instances Should Disappear From View
Mar 8, 2010
The Flash movie has three movie clips, square_mc and circle_mc that are draggable objects. The blackCircle_mc is the object that the other two instances, when dragged over it, should disappear from view. However, at the moment the example does not allow the movie clip instances square_mc and circle_mc to disappear. The instances disappear and are not visible in the target area of the blackCircle_mc instance, but not over the black circle area itself. The hitTestObject method is working on the target area outside the circle, but not within the circle circumference.
[Code]....
View 2 Replies
Similar Posts:
Mar 11, 2010
StartDrag, stopDrag, hitTestObject The Flash movie has three movie clips, square_mc and circle_mc that are draggable objects. The blackCircle_mc is the object that the other two instances, when dragged over it, should disappear from view. However, at the moment the example does not allow the movie clip instances square_mc and circle_mc to disappear. The instances disappear and are not visible in the target area of the blackCircle_mc instance, but not over the black circle area itself. The hitTestObject method is working on the target area outside the circle, but not within the circle circumference.
[Code]....
View 1 Replies
Dec 31, 2011
i created quiz. Questions of quiz, two question are fill inthe blank and others are multiple questions. i want to add matches question using startdrag-stopDrag. it runs in seperated fla. But it doesnt runk when i add to quiz.fla, actually mybadscrore doesnt work. However , how i can do to run only once square1.mc?
Code:
square1_mc.addEventListener(MouseEvent.MOUSE_DOWN, drag);
stage.addEventListener(MouseEvent.MOUSE_UP, drop);
function drag(e:MouseEvent):void
[Code].....
View 3 Replies
Mar 11, 2010
when I use startDrag() and stopDrag() to drag an object why doesn't it effect the x,y coordinates of the object? you can run this example and see for yourself (move the circle and look at the trace messages):
[Code]....
View 3 Replies
Dec 31, 2011
Actually i have a quiz.fla. In the file ,two of them fill inthe blank questions and others are multiple questions.square1_mc must run only once not twice. Ä°f user correct selected, doesnt run it again.However,if mybadscoretext is 1 not increase 2,3,4. :Show i can do all?
stop();
var myScore:Number = 0;
var myBadScore:Number=0;[code]....
View 1 Replies
Nov 9, 2009
I have a pretty simple function here where I want to start dragging a video scrubber along the x axis within bounds, and drop it when they let go. The code works perfectly if I don't specify a bounding rectangle (except it doesn't restrict to x-axis). What's up with that? Here's my non-working code:
Code:
videoConsole.scrubber.addEventListener(MouseEvent.MOUSE_DOWN, dragScrubber);
videoConsole.scrubber.addEventListener(MouseEvent.MOUSE_UP, releaseScrubber);
private function dragScrubber(e:MouseEvent):void{
[code]....
View 1 Replies
May 17, 2011
I know how to do the component UI scroll bar. But what I want to do is have my own custom scroll bar, and all the others tutorial looks confusing. I was just messing around with startdrag function and I notice that whenever you don't specify what you want to drag, it just drag everything. Ex: redBox_mc.startDrag(); will drag only the red box startDrag(); will drag everything. Using this I think I can make a UI scroll bar. The only problem is that everything go in the opposite direction. Is there any way I can fix this?
View 1 Replies
Aug 30, 2007
I can't seem to get the MC drag to stop
[Code]....
View 1 Replies
Apr 22, 2009
I have an icon that when pressed displays a msg. BUT why i decide to StartDrag that same movie clip, the icon seems to be disabled? My movie clips
[Code]....
View 6 Replies
Jan 30, 2009
I use startDrag in the code and it works. But when I try stopDrag it doesn't stop to drag.
View 1 Replies
Apr 27, 2011
I have a function that states when movieclip1 is dragged and hits a line then it stops the drag, however it seems to stop the entire drag function in the swf on the other movieclips even though they arent called in the function.[code]
View 1 Replies
Sep 25, 2009
I'm trying to make a simple maze game. I have movement working, and now I'm trying to implement collision. Here's what I have:
An 8x8 grid, with walls of length 1 to break the grid up into a maze. the walls are instances of a movieclip I've named "mc_wall" a guitar-pick-shaped chip I'll control the movement of a cross-hair called "arms" that will check if there are walls immediately surrounding my chip by way of collision. "arms" is a movieclip made up of four individual movieclips: "uparm", "leftarm", "rightarm", and "downarm"
I have currently named each instance of "mc_wall" to be "wall" this is the code I have now (using only right as an example):
function moveRobot(event:KeyboardEvent):void
{
doslide = true;
if (event.keyCode == Keyboard.RIGHT)
[Code]....
this will work, causing the chip to remain in place if the rightarm detects "wall", and move if the rightarm does not detect "wall". My problem is that, although I have named every instance of "mc_wall" to be "wall", the only "wall" flash will recognize is the last one.
Is there a way to adjust this code to look at all 70-or-so instances of "mc_wall" instead of only the last one?
View 1 Replies
Sep 11, 2010
Trying to do hitTestObject on instances that are dynamically placed on the stage. Receiving an error:
TypeError: Error #2007: Parameter hitTestObject must be non-null.
at flash.display::DisplayObject/_hitTest()
at flash.display::DisplayObject/hitTestObject()
[code].....
View 1 Replies
Dec 12, 2009
I am using Adobe Flash version 10.0.32.18
When on You Tube and watching a clip in Full View, the "Press esc key to exit full view" will NOT disappear like it use to, how can I get to disappear, its really interfering with the show?
View 2 Replies
Feb 11, 2011
i have an .as class that extends mx.containers.Canvas (it's a draggable border of a resizable component), it becomes draggable on MOUSE_DOWN and stops being draggable on MOUSE_UP, MOUSE_OUT and ROLL_OUT. before calling startDrag() i create a Rectangle to define the drag area, i also have a _dragging: Boolean variable to control if it's draggable at the moment. the problem is that when i click this border it jumps to a negative coordinate without calling startDrag or switching _dragging to true.
i've overriden get x, set x, get y, set y and move() methods in order to solve it but the only thing i got was the fact that position changes without calling coords setters or move(), but at the moment it's changed a getter is called and returns new (negative) value so my question is what happens on startDrag() and how to filter unwanted incoming coords values?
View 3 Replies
May 19, 2011
as you can see, I have a container MC which I have added to the stage. I set its drag constraints using a Rectangle(). I then add the 'cat' child movieclip to the container, and I want this to be dragable too. However, as soon as I click on my cat when testing the MC. It shoots to point x=0 y=0 on the stage and doesn't move.
The container MC can be moved without any trouble.
If I remove the rectangle bounds from the containers startdrag() function. both MC's can be dragged without any issue.
//panning ability
my_x = 800 - myImage.width;
my_y = 480 - myImage.height;
[Code]....
View 3 Replies
Aug 3, 2010
I'm about to have to write a web page/app that will serve the agenda for circa 100 people on a page. One line per person, one column per day with 3 clickable zones in each cell. In HTML, the page is way complex for the browser to load quick and there is no possibility to click on a border between 2 cells to for example split an event that spreads among several cells. So I search an not too overkilling technology to render this kind of view. I begun with a PHP generated HTML page but the number of elements in the page make the mouse move jerky.
Moving to JAVA would give me better performances regarding the reuse of the generator of the view but it will still be an HTML page. So, here is my question: do you think that going forward with JAVA and its graphical capability is the simple solution or is Flash a better option for this part of a Web App? I'm afraid of the code I'll have to write in JAVA to handle the GUI presentation as well as the events generated by the 1000's cells plus borders of the page. In Flash, the graphical part seems simpler even if the actions handling is still huge.
View 2 Replies
Aug 15, 2011
I'm currently using RobotLegs with the Presentation Model pattern to develop a Flex 4 project. I understand that all business logic related to a View resides in the Presentation Model associated with that view, however, I am confused when it comes to View specific logic.For example, I have an indicator that needs to be positioned relatively to list items depending on which list item is selected. Is it acceptable in the Presentation pattern to put the logic that will position the indicator in the View and simply have that logic run in reaction to a selectedIndex property changing in the presentation model?The reason I am considering this is that since the Presentation Model does not have a reference to the view it is difficult to come up with an ideal solution for manipulating view components.
View 1 Replies
Mar 18, 2010
I am wondering how to make a 360º view bubble, like they use for Google Street View, but have no idea how to go at accomplishing this task... i have the string of photos that i attached in photoshop(so that if you connected the left to the right it would be a full 360º view).
View 1 Replies
Jun 1, 2010
Is there anyway to add easing out to the stopdrag command? for example i drag something and instead of it stopping dead, it eases out.
I have tweenlite so maybe there is something in there that is possible to use?
View 3 Replies
Nov 9, 2009
I need a blue box with "man" typed into it made into a MC. (can do that bit).Which when I move it around on a startDrag command needs to change to "woman" in a pink box when it encounters a hitTest with other stationary words on the stage.I obviously need to stopDrag when the mouse is released.Is this about an MC inside another MC?
View 14 Replies
Aug 23, 2010
i'm trying to drag something, and on stopdrag it should start a function if certain requirements are fullfilled. My code looks like this.if(e.target.dropTarget.parent == targetName || e.target.dropTarget.parent.parent.parent.getChildByName("cloud").getChildByName("itemPlacer").getChildAt(1) == targetName){
I got 2 questions, first, this works good when i drag and stopdrag correctly(the requirements in the if are fullfilled). but if the requirements are not fullfilled i get an error saying that the place i'm referring to cant be null. I know that the problem lies after the || part but dont know how to resolve it. 2nd, isnt there a shorter way of doing these checks? Atm i'm going through alot of parents and getchildats and was wondering if there was another way.
View 1 Replies
Dec 4, 2007
I have a movieclip called background_mc; this movieclip contains 20 different movieclips each loading content. This works so far. When the minus key is pressed the background movieclip scales to 25% [this works] while scaled down the movieClip can be dragged around[this works]. I should note that while the movieClip is at 25% if a nested movieclip is clicked(onRelease) it tweens to 100% at the correct cooridinate. The problem is that after the movieClip is scaled back to 100% it can still be dragged whereas I only want it be dragged when scaled down.
If you look at schematic's site I am trying to achieve something similar. [URL]
This is my code so far
Code: Select allvar minusKey:Object = new Object();
minusKey.onKeyDown = function()
{
if (Key.isDown(109)) {
[Code].....
View 6 Replies
May 11, 2009
I don't even know where to go looking for this.
I have a game with a timer. Lots of moveable pieces using startDrag and stopDrag on a dropTarget. when the timer hits Zero, all the pieces are disabled using enabled=false;
but if I am mid-drag with a piece when the clock runs out, I can't get rid of it, and it won't let me hit my "reset" button.
View 2 Replies
Apr 7, 2009
I have a window that is dragable, but I want it to stop dragging not only on the release but when it hits a certain x and y cord. Here is my function:
Code:
function windowDragon(){
_root.partners_container_resize.partners_container.vidWin_Panasonic.vidWinheader_panasonic.onPress = function(){
_root.partners_container_resize.partners_container.vidWin_Panasonic.startDrag();
[Code] .....
View 2 Replies
Oct 14, 2011
I have a website with a slider that worked once upon a time. It still works if the swf is not added to the stage by the preloader. If I load the swf directly, rather than the html with the preloader, the slider works. Otherwise, the stopDrag() function appears to not work, making my video player's volume slider infinitely follow the user's mouse (which is completely unacceptable as you can imagine)
Keep in the mind, the slider works on its own... just after the site has been added to a stage of a preloader via addChild() does it not work.
View 1 Replies
Nov 25, 2010
I am using Flash CS4 AS3.. When I open my browser "Internet Explorer 7" it opens normal. But When I open a link using the following Flash code it opens half in length and half in width. I need to click on "Maximise" button to view in full. How to solve the problem? It is our Intranet link.
PM3.addEventListener(MouseEvent.CLICK,PM3ClickHandler);
function PM3ClickHandler(event:MouseEvent):void { navigateToURL (new URLRequest ("http://engineering/history/thisyear/ceomessage.htm"));
}
I tried modifying the line as well. It also doesnt work.
navigateToURL(new URLRequest ("http://engineering/history/thisyear/ceomessage.htm"), "_blank");
View 3 Replies
Jun 13, 2010
I have one .mxml file (the Application) with a ViewStack (with 4 views) and a ControlBard, obviously I can change the views with it, but what I want to do is: in view #1 I have an image which I want to convert to a "hyperlink", so when I click it I go to View #2, is this doable? Also I would like to pass somehow some data (like a String) to that View #2 (lets say the it's a user avatar I click so I want to go to the second view which will show me his profile, that's why I need his name/id).
View 1 Replies
Sep 28, 2011
My problem is that when I try to pass an object from the navigator.pushView(view, dataobject), I can't figure out how to access the dataobject from actionscript. I can access {dataobject.property} from MXML easily, but I want to set a variable in the new view to the passed dataobjects property.
View 1 Replies
Oct 8, 2009
in flash, I encounted a source file that is cropped and I cannot move it, is there some sort of cropped view in flash I dont know about? I cannot find anyinformation about it, it has rulers displayed as far as I remember.
Basically you cannot move in the file to edit anything viewpoint wise, everything outside of the movie area is invisible and not there? As if cropped.
View 0 Replies