Make Something That Will Check All Var's On The Objects In The _root Time Line?

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


Similar Posts:


AS3 :: Flash - Check For Objects Intercepting A Line Of Sight?

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

ActionScript 2.0 :: Leaving And Embedded Time Line To Main Time Line

Mar 25, 2010

My issue is that for my website I want there to be movies in between the interactive parts of it where the interfaces slide in and out. However, I can't stop a movie from playing over and over instead of playing once and going to the next frame.With 2.0 I haven't been able to find any research that helps me, probably because I don't know the correct keywords to search for.Right now I have my main time line set up with a loading bar on frames 1 & 2, that then jumps to frame 3 where I have embedded a movie (Instance named: mc_start) of the interface sliding in. Preferably after that I need it to jump to frame 4 where the actual interface is.

I can get the movie to end by going into the embedded movie's time line and simply have stop() ; at the final frame, but I can't get it to go to frame 4 on the main time line. If I having something like gotoAndPlay(4) ; on the final frame of the embedded movie's time line, it simply goes to frame 4 of the embedded time line and not frame 4 of the main time line. If there was a command to make it jump back to the main time line instead of the embedded time line, that would work perfectly.Coding on Frame 3 of the main time line to jump to Frame 4 would work if I knew the correct language to detect when the movie has ended (Movie is 191 frames long), so that afterwards it would immediately jump to Frame 4, but I haven't been able to find any resources that will teach me how to do it. Right now having gotoAndPlay(4) ; on Frame 3 of the main time line obviously makes it immediately skip the movie on Frame 3 and jump to Frame 4.

View 2 Replies

ActionScript 3.0 :: Control A Movieclip Time Line From The Main Time Line?

May 15, 2011

What I have is a movieclip and a button in scene 1 (which is the main timeline).There is an actionscript layer also on the main timeline. what I want to do is when I click the button, it would do a nextFrame(); in the movieclip timeline instead of the main timeline.

View 4 Replies

Professional :: Make A Line Vector Get Longer Over Time?

Sep 18, 2010

I'm trying to make straight lines grow out of a stationary dot, like veins. I've tried shape tween, but it only works for shapes, not lines. I'd just get a blank workspace when I hit play. I've also tried motion tween, but I can't get the line to grow continuously to a point.

View 11 Replies

Professional :: Stretch Or Make The Time Line Smaller Or Consolidate It?

Aug 8, 2011

how do I consolidate adobe flash arrange window area so that I can make my time line small to be able to see the whole movie with keyframes how I want to see them.  there are some times I have to scrool alway the way right, how do i avoide from doing this?
  
Something similar to how adobes audition stretches waves is this possible to do in your timeline?

View 6 Replies

Flex :: Make TextArea Dispatch An Event Each Time A New Line Is Taken?

Nov 1, 2010

Every time a user takes a new line (i.e each time they press the return/enter key) when typing in a textArea, I would like the textArea to dispatch an event.I can then listen for this event and then carry out some processing on the textArea's contents.

View 2 Replies

IDE :: Make The Movieclips That Act As Buttons Play Certain Frame On Time Line?

Feb 24, 2009

URL...My question is how can i make the movieclips that act as buttons play a certain frame on my time line? ....i don't know where or what to insert.

View 1 Replies

Flash :: Relationship Of Code On First Frame Of Main Time Line To Class Code And Library Objects?

Mar 27, 2011

Got to the point where the hole in my AS3 knowledge is getting large!Realising I have confusion about the relationship of:Body of code on first frame of AS3 file.(Which I have so far used to create instances of library objects using addchild and make calls to class code).Is this code called the document code? What do people call it?Numerous classes linked together by extending each other etc.Library objects (usually graphical objects)Should it be done differently? have the following problems due to lack of understanding:Addchild complicated from a class but straight forward in main body code.Cant call functions on the main body code from classes, because class code does not know the main body code exists?

View 1 Replies

ActionScript 2.0 :: API-draw: Check If Line Intersects Another Line

Apr 13, 2005

I'm making a very simple game that lets you draw a curve by hand (using lineTo to the mouse position on mousemove) but now, I need to check wether the line intersects wiith another part of the same line (e.g. a loop)

I first used an onrollover command, and that worked, but not always because the mouse moved too fast (same with hittest with mouse). Then I pre-drawed the line in another mc, used hittest on it, and if it wasn't intersecting, draw it in the real mc. But that didn't work because it used the bounds to test. I guess the best way is to use some mathematical formula, but that would mean I have to save all my coordinates in an array..

View 5 Replies

ActionScript 2.0 :: Use The Var ClipName To Find The Location Of Each Movie Clip Found On _root In The Next Line?

Jan 20, 2005

// code to find out all the movieclips on _root
for (var property in _root) {

if (typeof _root[property] == "movieclip") {
var clipName = _root[property]._name;

// I am trying to use the var clipName to find the location of each movie clip found on _root in the next line

//the next line gives me "undefined" why?

clipBounds = [clipName]getBounds(_root);

}
}

View 2 Replies

ActionScript 2.0 :: _root - Rollovers On The Same Dropdown All Playing At The Same Time

Dec 3, 2004

I am trying to create rollovers in dropdown menus that i have. I am having a problem with the rollovers on the same dropdown all playing at the same time. The rollovers play backward and forward correctly as they should but when you mouse over one of seven they all play.

[Code]...

View 2 Replies

Professional :: Displaying Time - According To Time Line

Feb 15, 2011

I have a time line of 1441 frames my frameRate is 24 fps so it takes 1 minute exactly to complete the timeline animation I want to Display the Remaining time as file starts I need formula to place in ENTER_FRAME event which displays the time left

View 2 Replies

ActionScript 3.0 :: Displaying Time , According To Time Line?

Feb 15, 2011

I have a time line of 1441 framesmy frameRate is 24 fpsso it takes 1 minute exactly to complete the timeline animationI want to Display the Remaining time as file startsI need formula to place in ENTER_FRAME event which displays the time left

View 1 Replies

ActionScript 2.0 :: Change The _root.broj And _root.logo Variables Inside The Function?

Jan 14, 2010

In the code below i want to change the _root.broj and _root.logo variables inside the function which returns values from .php file. Inside the function everything works fine and all values are correct but when i trace var broj outside the function it's still 0.

var result_lv:LoadVars = new LoadVars();
var send_lv:LoadVars = new LoadVars();
var broj:Number=0;
var logo = new Array();

[Code].....

View 1 Replies

ActionScript 2.0 :: "duplicateMovieClip" Function - Duplicate A Line 4 Times And Move Each Line On Yaxis With A Delay Of 1sec Each Time

Nov 16, 2005

i want to duplicate a line 4 times, and move each line on Yaxis, with a delay of 1sec each time. I know i must use setinterval+duplicateMovieClip, but i've got pbs :-( actually, i've got my AS code on my line :

[Code]...

View 7 Replies

ActionScript 2.0 :: _root.cargo Are Multipled By 10 And Added To _root.totalscore?

Feb 27, 2003

im lookin to make this so that the points taken from the _root.cargo are multipled by 10 and added to _root.totalscore

[Code]...

View 2 Replies

Flash - When Drawing A Freehand Line With The Cursor, How To Make It A Dashed Line

Nov 23, 2011

I am using Flex 4 and AS3 and I am trying to make it so that the user can draw a freehand line with the cursor - I have this part done.However, I also need the line to be a dashed line instead of one solid line like it is now. below is my code I am using. I have found some examples on how to do this, but they are all for straight lines, not for a freehand line.

Class File (DrawingArea):

package
{
import flash.display.BitmapData;
import flash.events.Event;
import flash.events.MouseEvent;

[code]....

View 3 Replies

ActionScript 1/2 :: Make The For Loop Continue Only After _root?

Sep 28, 2010

for (i = 0; i < _root.myArray.length; i++)        {                _root.searchAndDestroy();        }
 
how do i make the for loop continue only after _root.searchAndDestroy(); has finished it's task?

View 7 Replies

ActionScript 2.0 :: Check All Points Along A Line?

Aug 20, 2009

I'm using Flash 8 and AS2 I am attempting to make some code that checks whether or not a line that rotates around the screen is hitting a movie clip. Here is my code (with comments explaining it):

[Code]....

View 3 Replies

ActionScript 2.0 :: _root._root[eelmine].nextFrame()?

Sep 14, 2004

if a condition is true, then:_root.(MC with instance name that is the value of "_root.eelmine").nextFrame(); is this correct?_root._root[eelmine].nextFrame();

View 16 Replies

ActionScript 2.0 :: Check If A String Contains Different Characters In Just One Line?

Sep 24, 2003

Is there a way to check if a string contains different characters in just one line?

//this would be for just a:
if (stringAnalyzed.indexOf("a")!=-1){
//whatever actions;
}

[code].....

I know this doesn't work. What is the right syntax?

View 2 Replies

Flash :: Check Whether Line From Point(x1,y2) To (x2,y2) Intersects This Shape?

Mar 11, 2011

Given a MovieClip containing a vectorshape (loaded from the library) - is there a way to check whether a line (from point(x1,y2) to point(x2,y2) intersects this shape?

View 1 Replies

ActionScript 2.0 :: Keep Getting ; Expected On The "_root.3dbutton.tween("_y", 198, 1);" Line ,using A Tweening Prototype?

May 23, 2004

onClipEvent (mouseDown) {
if (hitTest(_root._xmouse, _root._ymouse, false)) {
_root.3dbutton.tween("_y", 198, 1);
}
}

i keep getting ; expected on the "_root.3dbutton.tween("_y", 198, 1);" line.im using a tweening prototype.

View 4 Replies

ActionScript 2.0 :: Using Eval To Check Through All The Objects?

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

ActionScript 3.0 :: No Longer Move The "_root" By Changing The _x And _y Positions Of The _root?

Jan 26, 2009

I just recently began migrating from AS2 to AS3, and I have of course realized that I can no longer move the "_root" by changing the _x and _y positions of the _root (which no longer exists in AS3). How can I do this in AS3 (specifying _x, _y, _z possibly of the "_root")?

View 2 Replies

ActionScript 2.0 :: Check A Run-time Drawing?

Jun 19, 2011

I made a run-time drawing board, to draw a specific shape by using movieclips. But I don't know how to check it. For example, if they draw a rectangle, I want a message to show up. How can I check a drawing?

View 1 Replies

ActionScript 2.0 :: Check The Value Of 5 Different Variables At The Same Time?

Oct 26, 2005

I wanted to check the value of 5 different variables at the same time.

Based on the value each of variable I wanted to make 5 corresponding movie clips do something.

There has gotta be a better way to do this rather than me using a bunch of if else statements.

View 4 Replies

IDE :: Time/Season Check And Change?

Feb 25, 2009

I'm trying to setup a header / banner to play around with some as3 function and learn more. Really basic the Project checks the Time and Month and thus it changes the time of day and the season. Currently I'm having trouble with my Refresh Class because I need it to keep checking every "15 minutes or so" is it is still (for example) night or the time has just changed to morning in which case the morningSky will get created.

I got the script to refresh but it doesn't seem to change the Time and Season when the computer time and date is changed. I think it has something to do with the return function in the TimeCheck class (I also have SeasonCheck which is build up the same).

PHP Code:

[code]....

View 1 Replies

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







Copyrights 2005-15 www.BigResource.com, All rights reserved