Professional :: DropTarget Check Against All Objects On The Stage
Oct 1, 2010
Not sure the best way to do this. I have a class we will call DropActivity, here is the code
[Code]...
when the stopDraggingMe() method is called from another object (code shown below) I need to see all the objects on the stage to see what objects on the stage my currently selected movie clip is over and assign it to the dropCheck.checkAgainst method (that will be checked against an array to see if it can in fact be dropped, if so set the canBeDropped value to true and therefor run the .stopDrag() ). I have read using root is not a good coding practice in AS 3.
[Code]...
View 3 Replies
Similar Posts:
Aug 12, 2011
Is there a way to check an objects x,y coordinates based on where it is on the stage, vs. where it is in the movie clip that is on the stage?
need this to compare with the mouse for instance.
View 2 Replies
Oct 9, 2010
i have several check boxes and input texts on stage and would like to null out their values with a reset button but seem to be having issues, can anyone take a look
[Code]....
TypeError: Error #1010: A term is undefined and has no properties.
at Main/resetHandler()
View 9 Replies
Apr 9, 2010
Unfortunatly im having to extend to more draggable objects. So they will be within another movie clip so i can have them scrolling. After making the scroll, the draggable objects dont register on the droptarget as they are within another movie clip. Below is i think the part of the code that needs to be changed so the draggable objects know where to find the drop target.
View 1 Replies
Apr 27, 2010
I am using Flash CS4 and need to resize my Flash stage and all objects therein.
To do that I activated onion skin tool, selected all objects and all frames and resized by using the transform tool.
However, masks and some motion paths are not scaled proportionally.Is it yet another bug in CS4? Here is a video illustrating the [URL]...
View 5 Replies
Aug 17, 2011
I increased the size of my stage to 1280 x 1024 and now objects on the periphery have disappeared. When I zoom in they appear, but when I zoom out or export the movie the objects in the center are there but the objects around the edge do not appear. If I add an object and drag it to the edge I can watch it disappear as I am dragging it, but when I zoom in it is there. I have no masks and I need to create the video at the higher resolution, so I cannot resize the stage smaller.
View 3 Replies
Sep 24, 2011
lets say I have animated a car entering the stage area from outside the stage. When I render the SWF at first only the content on the onstage area is visible but if I resize/enlarge the window I can also see the car(content) lying outside the stage just like in the flash file. How can I make sure that no off stage content is visible at all in the final SWF?
View 4 Replies
Aug 16, 2011
I am a newb to Flash CS5 Pro, so I can't tell what is wrong. I have multiple objects on my stage that I copied to create afull effect. Most of the objects perform perfectly, but the ones on the edge of the stagedisappear when I export to video. When I zoom in to look at them, they are there,but when i zoom out to fit to page, they are gone
View 2 Replies
Aug 8, 2010
I need to create an object in code which can then be imported to the stage. Specifically it's a circle with an ellipse cut out of it. The size and position of the ellipse masked out need to be parameterized by sliders, and the size of the circle as a whole is also a parameter which might be dragged out on the stage.
Does anyone have an example of how to programatically create an object in action script which can be imported to the library which can take parameters (or rather expose some methods) which can be wired to other things in the project like a knob or slider?
View 7 Replies
Oct 6, 2010
I want to find out how to find objects on stage in order to change their names, using actionscript in run commands.
View 2 Replies
Feb 25, 2003
I was reading another query on this board about NOT using eval, as it had become deprecated, for attaching a name to a new MC. I have been using eval to check through all the objects, and to add ones with a certain name to an array.
for (i in this) {if ((typeof (eval(i))) == "movieclip" && substring(i, 1, 5)== "names") {
would there be another method of doing this using dot notation? sorry if this question seems a little muddled. I am new to flash, some things in it make a lot of sense and others are still confusing me.
View 3 Replies
Jul 24, 2010
I have drawn colored rods which I have placed in the library and have put one of each on the stage with instance names likeblueRod_mc, etc.I place them around with time-line code like
blueRod_mc.x = 300.0;I have now created an Actionscript class called Problem.I build a new object from Problem which I have called Riddle.But when I put blueRod_mc.x = 300.0 in a method (of Problem),I get the message that blueRod is not accessible.So I triedstage.blueRod_mc.x = 300.0;That did not work either.
View 9 Replies
Feb 10, 2012
Is there an easy way to compare two TextFlow objects with each other? I have two text flow objects that are created with TextConverter.importToFlow() and want to check if they are equal or not. Only way I found so far is to use TextConverter.export() to export them to a string then compare which seems bit convoluted...
View 1 Replies
Oct 19, 2011
I'm writing a web based flash app that's written entirely in AS3. I have objects on the screen as part of a GUI. I would like the user to be able to resize the window, or make it full screen. I would like everything to auto-scale with the resize, but also remain in the same relative position on the stage.
View 1 Replies
May 9, 2011
I've for a while now been trying to work out an efficient way to see if something is in something else's line of sight. A good example is having a sphere that fires a rocket at you if it can see you - but obviously not if you're behind a wall.
Here's how I generally went about doing this:
function cast(end:GameObject, walls:Array, accuracy:uint=10):Object
{
var xp:Number = skin.x;
var yp:Number = skin.y;
[Code].....
Works, but as we know this will get extremely slow with each new rocket added or as the amount of impassable objects increases.
I'm assuming there's a really simple efficient way that I'm missing - I mean, all games do it (Diablo, etc) with hundreds of enemies that don't do anything unless you're visible.
View 3 Replies
Apr 4, 2009
How to make somethig that will check all var's on the objects in the _root time line? lets say "allObjects" means all the objects in the _root time line:
Code: Select allif(_root[allObjects]._loc1==1){
doSomething()
}
So lets say that I have 20 pieces of an "A" MC and one of a "B" MC, 10 of the "A" MC have the code "_loc1=1" and the rest have "_loc1=0" and if I roll over the 10 A MC that have _loc1=1 the B MC will gotoAndStop(2) but if I roll over the rest of the A MC's nothing happens.
(the A MC's have different names like: planetX; ship21; enemy61; ... )And a var in the _root time line will have the name of the MC that has the mouse over it (rolled over it)So something like: var MCname = "planetX"
View 4 Replies
Nov 21, 2010
Anyone know if there's a way to check for objects in memory that have been removed from a display object but not set to null?
View 1 Replies
Nov 13, 2010
this.stage.loaderInfo.bytesTotal; with that line of codedoes stage mean the loading of the entire swf is monitored or the loading of objects which are used on the stage are monitored? can specific objects (say a specific movie clip) be targeted?can externally used AS scrips be targeted? and what does "this" doe
View 8 Replies
Nov 10, 2010
When I copy layers and edit the objects on stage, the objects also change in the other layer(s).
How do I duplicate a layer so that I can modify it with the objects in the old layer being unaffected? There must be a really easy way?
View 2 Replies
Sep 15, 2007
I have a movie clip that is added to the stage.. by the instance name of PHP Code:"ITEM1"Is there a way to check if a particular movieclip/instance is already on the stage?Maybe something along the lines of
PHP Code:
if(_root.ITEM1 == true){}
View 2 Replies
Nov 24, 2010
Is there a way to check if parent object is added to stage inside a class, before child is added to stage. Something like this:
PHP Code:
public class Main extends MovieClip public function Main() var test:MyClass = new MyClass();addChild(test);}}public class MyClass e
[code].....
View 2 Replies
Nov 28, 2004
I am trying to write an IF Else statement that will check to see if a movieclip on the stage has an external SWF loaded in it that was loaded using the loadMovie command. Does the loadMovie command or the internal movieclip object have any kind of a built in function that will return a value if it has an external SWF loaded in it?
View 1 Replies
Nov 29, 2009
in AS2 it was
Code:
on (press) {
startDrag(this);
}
on (release) {
[Code]...
i want "x_mc" to droptarget on "y_mc" and use an action
View 2 Replies
Feb 18, 2009
I'm having a little problem of which I'm guessing the solution isn't that hard.. but I just can't put my finger on it...
The thing is: I have got 5 movieclips which are able to drag and drop. Next to that I've got 20 containers which are all droptargets. The movieclips are able to be dragged and then dropped on a container. So far so good. But what I want is that when I drop a movieclip on a container which already has a movieclip dropped on it, the first movieclip gets removed and the second movieclip is dropped on the container. Or you could also say.. that the second movieclip replaces the first movieclip. This instead of the fact that a container has multiple movieclips dropped on itself.
[Code]...
View 3 Replies
Feb 13, 2009
I'm trying to create a slideshow, using Flash CS3 and AS3. I have 6 thumbnails with buttons attached to them, and then 6 movieclip images placed on the stage manually, each on a different layer. Inside of each image MC (i.e. image01_mc is the instance name of the first image), the image is animated to enlarge outwards from the thumbnail to make a larger version of the image. Standard operating procedures, and all that. So far, the buttons successfully call upon the frame label inside the imageClips to enlarge.
The next part of the problem is that when clicking the next thumbnailButton, I want the currently enlarged image to diminish in size back to its thumbnail, so that the next image can take its place. I have a frame label inside those imageClips to make that animation.
I think, with my rudimentary understanding of AS3, that I need to find out which movie clip instance is on the stage, using If statements, with some code to gotoAndPlay the frame inside the imageClips that shrinks the image.
I've tried various combinations of If, Else if, getChildByName, etc, that I've found in numerous posts, but nothing seems to work.
View 4 Replies
Nov 19, 2008
I want to check if the stage is loaded with stuff. If it is, remove it and load my new stuff. If it isn't load my stuff.
View 1 Replies
Feb 18, 2008
for AS3.people thi is how you rock:
ActionScript Code:
if (neslide.map) {
//var maptween:Map = new Map(this,origwidth,origheight);
[code].....
View 4 Replies
Jan 22, 2009
Is it possible to check, using Javascript and without altering the ActionScript code at all, if a child has been added to the stage? I have in mind something like being able to call GetChildByName in Javascript, and if the child exists, call another javascript function.
View 0 Replies
May 17, 2010
In AS2, to check if the mc is removed frm stage, i wuld simply just need to do this:
Code:
removeMovieClip(mc);
trace(mc);
[code]......
View 4 Replies
Oct 27, 2010
i am trying to check if the movieclip has left the stage. by using the Stage.width. When the movieclip leves the stage no it not recognised. As the trace function does not appear.
var stageName = Stage.width;
var speed:Number = 5;
box.onEnterFrame = function(){
[code].....
View 7 Replies