Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Moving Graphic To Unknown Coordinates


I have a navigation bar that has a small graphic placed at the current menu option. Currently, when I click another option it jumps to that tab. I want to create a movie clip to make the graphic to slide nicely over to the next object. What is the best technique for doing this?




FlashKit > Flash Help > Flash ActionScript
Posted on: 11-08-2003, 12:13 PM


View Complete Forum Thread with Replies

Sponsored Links:

Moving Clips To Specific (x,y) From An Unknown Location
Okay Flash Gods... I have a clip that is floating about the stage... now when I release a button I want the clip to travel to a specific point on the stage... by travel I mean I want to see the clip move to the point.. not immediately appear to it.

I'm using Flash MX (not 2004)

-Pez

View Replies !    View Related
Clicking Coordinates And Graphic Symbol Placement
I'm making a point and click shooter but the user is throwing an item rather than shooting (ie snowball). The problem is a thrown snowball has a path of travel as opposed to a gun which you wouldn't normally see it's route to a target.

I've a movie clip called 'snowballthrow' which is basically 6 frames of a snowball getting smaller. I'd like the snowball to start in the centre of the bottom half of the movie with frame 6 of the movie ending up on where the user has clicked. I thought about having the movie symbol on a motion tween but how do I go about specifying where the movieclip ends on the stage.

I'm using Flash 5 and the movie is 500 x 350 px

View Replies !    View Related
X & Y Coordinates MOVING?
I am loading a XML file which contains lets say "9" "coupons". For each "coupon" that exists it fills it with the text content and creates a coupon "object". Then it positions them 2 accross and down however many.

So in my html I have some code that counts the # of coupons and then multiplies that by the size of 1 coupon "150px" . So if 9 coupons exist and I have them 2 across, I would have a total of 5 rows. I use a Math.ceil(count/2). This number is the number I use to resize the "Height" property of the object and embed tags in the html.

The problem is that is moves the x,y coordinates to the middle of the page whenever its scaled like this. therefore only about half of the coupons show up?!?

Here is the complete code for my movie...it exists on frame 1.


Code:
stop();
init = function (myXML) {
// do xml stuff
this.coupon_xml = new XML();
this.coupon_xml.ignoreWhite = true;
// when loaded - do couponLoaded
this.coupon_xml.onLoad = this.couponLoaded;
// move a level down
this.coupon_xml.parent = this;
this.coupon_xml.load(myXML);
};
couponLoaded = function (success) {
if (success) {
// if loaded - ready the couponNodes
// makes them easier to access
// do initCoupon
this.parent.couponNode = this.firstChild;
initCoupon();
} else {
trace("loading failed");
}
};
var ID = 4683;
var Xspacing = 0;
var Yspacing = 0;
var level = 1;
var counter = 1;
initCoupon = function () {
coupCount = this.couponNode.childNodes.length;
for (var i = 0; i<coupCount; i++) {
if (counter == 1) {
trace("# of Coupons = "+coupCount+newline);
var yStart = (((Math.ceil(coupCount/2)*300)/4)*-1);
trace("yStart= "+yStart);
}
var iterate = i;
trace("Iteration Count = "+iterate);
// var to shorten xml paths
var subNode = this.couponNode.childNodes[iterate];
// vars for initObj to follow
this.dealerName = subNode.childNodes[0].firstChild.nodeValue;
this.topText = subNode.childNodes[1].firstChild.nodeValue;
this.midText = subNode.childNodes[2].firstChild.nodeValue;
this.bottomText = subNode.childNodes[3].firstChild.nodeValue;
this.expText = subNode.childNodes[4].firstChild.nodeValue;
this.address = subNode.childNodes[5].firstChild.nodeValue;
this.cUrl = subNode.childNodes[6].firstChild.nodeValue;
// build and position Coupons
// --------Get XY 0,0 cords...
trace("URL= "+cUrl);
trace("Counter = "+counter);
var modC = counter%2;
trace("modC = "+modC);
if (modC == 0) {
Xspacing = 155;
} else {
Xspacing = 0;
}
if (counter != 1) {
if (modC != 0) {
Yspacing = yStart;
yStart = yStart+155;
}
} else {
Yspacing = yStart;
yStart = yStart+155;
}
counter++;
// ------initObj for attachMovie
var initObj = {cUrl:this.cUrl, dealerName:this.dealerName, address:this.address, topText:this.topText, midText:this.midText, bottomText:this.bottomText, expText:this.expText};
var name = "couponHolder_mc"+iterate;
y = Yspacing;
x = Xspacing;
trace("X cord = "+x);
trace("Y cord = "+y);
trace("------------------------------"+(counter-1)+newline);
newCoupon = this.couponHolder_mc.attachMovie("coupon_mc", name, counter, initObj);
level++;
// -----Position and Scale the coupons accordingly
newCoupon._y = y;
newCoupon._x = x;
newCoupon._xscale = 50;
newCoupon._yscale = 50;
// --------Define onPress logic
newCoupon.onPress = function() {
trace("onPress Called! "+this.cUrl);
getURL("java script:window.open('"+this.cUrl+"','yourPopup','width=410,height=400')");
};
}
};
Stage.scaleMode = "noScale";
checkresizer = new Object();
checkresizer.onResize = function() {
newCoupon._height = Stage.height;
};
emptyClip.onEnterFrame = function() {
Stage.addListener(_root.checkresizer);
};
trace("URL= "+this.cUrl);
init("http://www.mysite.com/assets/sitecoupons/xml/xmlmultiple.asp?ID="+ID);




Please and thanks for any help!!!!

View Replies !    View Related
Moving A Background To Different Coordinates
Hi All,
I am attempting to create something like this where I can click a button or something and it moves the background to a a different point. What I have so far is just using something like background._x = -373.2; but this doesnt allow me to see the actual movement. Can anybody help me out with this?
Thanks,
DP

View Replies !    View Related
Mc Moving According On Mouse X And Y Coordinates
Iīm trying to make a MC to change itīs x location according to the mouse position. Letīs say that the Mc moves to x=100 when the mouse_x is > 300 and y < 200. and moves back when the mouse goes back.

thanks

View Replies !    View Related
Moving Menu To New Coordinates
Hi,

Iīm trying to acomplish this:

3 buttons, one on top of the other, being 40 pixels far one from the other.
Iīd like to, when any of the buttons clicked, for all of them to move 40 pixels down, changing positions, BUT... the last button has to change places with the first one, going from outside the canvas...
Here I attached an animated example of what I whant...
Does anyone have any idea for me? Thanks for anythig

View Replies !    View Related
Moving Picture To Different Coordinates...
Hi,

I have a problem here that I can't seem to figure out with my limited action script skills...

I have this picture which has the dimensions 5599x660 and it's kinda like a moving background, it's moving to the left.

Now, when it reaches the end I want it to be replaced by the same pic...

Stage size is 950x720.

I came up with two possible options:

1. make a duplicate of the pic movieclip and place it on stage right behind the first one and then when the first one is off stage place it right behind the second one and so on...

2. have flash duplicate the pic automatically and place it right behind the original one (I read about that option somewhere I think it's called DuplicateMovieclip)

Now I tried to go with option #1:


Code:

var xspeed:Number = 20;
function moveLeft() {

if (this._x < -5600) {
this._x = 5598;
}
this._x -= xspeed;
}


img.onEnterFrame = moveLeft;
img2.onEnterFrame = moveLeft;
--> 'img2' is place right behind 'img' on stage

So here's the problem:

1. it works, but after the first round - it goes through image 1 (img) then through image 2 (img2) perfectly and then when it's supposed to place image 1 right behind image 2 there's a space of about 100 pixels between them... I don't know why because I gave the right x coordinates in the code...

2. now when u still go on and u go through (the misplaced) image 1 (img) and then u come to the point where it's supposed to place image 2 (img2) right behind image 1 there's also a space between them but only maybe of 5 pixels...

How come that with the same pictures with the same code for both of them it's doing something different both times ?

Any help is greatly appreciated and I thank u in advance for that !!

Regards,

Mike

View Replies !    View Related
Mc Moving According On Mouse X And Y Coordinates
Iīm trying to make a MC to change itīs x location according to the mouse position. Letīs say that the Mc moves to x=100 when the mouse_x is > 300 and y < 200. and moves back when the mouse goes back.

thanks

View Replies !    View Related
Question On Moving An Object's Coordinates Away From A Point
hi

the question i had was the math equation to move an objects coordinates

away from the center of the world... which in my case is 512, 386 on a flat plane.

depending on the angle of the object and the center of the world what would

be the equation to move the object away from the center, keeping the same

angle as the beginning?

i can think that just multiplying the delta x and delta y by a certain number

could simplify the process but wouldn't be accurate in the rate of speed

it was getting away from the center...

it has been so long since i had to think about these problems...

oh and it would be nice if someone could help giving an equation that

can be used on a frame based increase...

thanks

View Replies !    View Related
Moving A Graphic Every X Seconds...
I'm just starting to learn action script, and recently got some help here for something I was working on... I'm just making a flash file that I'm playing around in to learn action script...

Is there a way to move a graphic across my stage at random time intervals.

Say my stage is 900 pixles wide and I have a 30 pixle wide image... is it possible to have flash make up random time points and move the image off the stage? Is it possible to make it do this at random speeds also?

Thanks for all your help everyone... I'm definetly learning.

View Replies !    View Related
Moving An Over Sized Graphic.
This is sort of an AS question and sort of not. I am trying to figure out the best way to move a very large graphic around. I am building a vector city map and I want to be able to zoom in and out, turn on and off various layers on the map etc.
In theory I think I know how to manage this, except for one thing. The graphic of the map is already HUGE and I still have not finished drawing it. In my most preliminary tests I can’t get it to scroll or move at more than about 1 frame per second. I was thinking about chopping it up into a lot of smaller graphics, fitting them edge to edge and then turning them on and off depending if they are in the visible portion of the screen or not. Maybe using a few MCs and loading parts of the map into them as you scroll across the surface of the map?
The trouble is also that I don’t completely understand which things slow down an animation more than others.
Anyone run into something like this before, or have any ideas / suggestions as to how to approach it? I am trying to get it to perform at 20fps, or at least the standard 12.
Wild, theoretical and impractical solutions welcome.

View Replies !    View Related
Moving Window To Specific Coordinates On Button Click
I need code that tells a window/box/object in my site to move to certain coordinates when a button is clicked.

Yea...I'm new to actionscript

Thanks

View Replies !    View Related
Have A Moving Ball On Screen... Want Coordinates In Text Boxes
first off i am using flash mx 2004

i am trying to get a ball to move around on the screen cooresponding to pressing the appropriate arrow keys... i got that to work

i also want the x/y coordinates of the circle to always be displayed in text boxes... i keep getting an "undefined" in the text box instead of the coordinate...

i created the circle... converted it to a movie clicp called "circle"

i then clicked on the circle and put the code to move it if arrow keys are pressed

PHP Code:



onClipEvent(enterFrame){ blah blah blah (it works just find) }




then i created a new layer called actions... i threw 4 text boxes on the screen... 2 of them are just regular static fields that say Xcoord: and Ycoord: .... the other two are dynamic text boxes with varx and vary

i went to the actions for that layer and typed

PHP Code:



varx=_root.circle._x;  vary=_root.circle._y;




i thought that would work but as i said it just displays "undefined" in the boxes


it must be a simple problem... and i hope i am posting correctly... thanks!

View Replies !    View Related
Moving A Clip OnPress With Actionscript To Current X0, Y0 Coordinates
I have a site I'm working on in which the movie fills the browser space and elements are repositioned according to the available space or if the window is resized - http://www.oroborusmovement.com/flashTest2.html

The navigation elements are some spinning circle movie clips that are centered on the stage stored in a container.

What I want to happen is when one of the rings are clicked, the whole navigation moves to the current x 0, and y 0 coordinates so it is repositioned in the top left corner with a quarter of the navigation showing.

I've been having a hard time finding info on how to have a clip move when it is clicked itself, and then I'm not sure how to calculate the current x 0, y 0 coordinates to have the nav move there.

I'm trying to avoid using any frame tweening and would prefer to have everything controlled via actionScript.

I have uploaded the source file here - http://www.oroborusmovement.com/flas...tResizable.fla

Any help would be greatly appreciated

View Replies !    View Related
Arrays, Generating Target Coordinates, Moving Stuff
Hi,

I'm sure this has been addressed somewhere (and I'm sure many of you get tired of dealing with similar inquiries), but after combing through threads on arrays and random numbers, I'm still not sure how to do the following:

I have 23 dots that I'd like to move to randomly generated coordinates within a container. From what I can tell, a good method to do this is to create target movie clips and then have the dots go to each corresponding target mc. It seems to me that I could avoid the use of a separate movie clip for a target, but visually it makes sense.

For one of these dots, with a static target, I wrote the following code:

_root.Dot1.onEnterFrame = function() {
//_root.running is a variable that runs on button rollOver
if (_root.running && Math.abs(_root.staticTarget._y-this._y)<1 && Math.abs(_root.staticTarget._x-this._x)<1) {
// set position and hang out
this._y = _root.staticTarget._y;
this._x = _root.staticTarget._x;
_root.running = false;
} else if (_root.running) {
this._y -= (this._y-_root.staticTarget._y)*.2;
this._x -= (this._x-_root.staticTarget._x)*.2;
} else {
// wait for button rollOver
}
};

How can I do this for 23 dots all at once, and for the targets not to be static but randomly generated? And additionally, if I wanted to avoid having dots go to the same x or y coordinates (or both), does this get way tricky? Having seen some solutions to arrays and random numbers, it seems like it is doable.

Thanks in advance.

View Replies !    View Related
Moving A Clip OnPress With Actionscript To Current X0, Y0 Coordinates
I have a site I'm working on in which the movie fills the browser and elements are repositioned according to the available space or if the browser window is resized - http://www.oroborusmovement.com/flashTest2.html

The navigation elements are some spinning circle movie clips that are centered on the stage stored in a container.

What I want to happen is when one of the rings are clicked, the whole navigation moves to the current x 0, and y 0 coordinates so it is repositioned in the top left corner with a quarter of the navigation showing.

I've been having a hard time finding info on how to have a clip move when it is clicked itself, and then I'm not sure how to calculate the current x 0, y 0 coordinates to have the nav move there. I can point the nav to the coordinates, but if the window size changes, those values seem to no longer apply and the nav moves to what it thinks are the x 0, y 0 coordinates.

Someone had suggested that I can use localToGlobal, but I'm don't know how to use the function to animate the navigation -

var point:Object = {x:0,y:0}; //assuming your registration point is in the center of the circles.
circle_mc.globalToLocal(point); //circle_mc being the movie instance that you want to get your globalToLocal x and y.
circle_mc._x = point.x;
circle_mc._y = point.y;

I'm trying to avoid using any frame tweening and would prefer to have everything controlled via actionScript.

I have uploaded the source file here - http://www.oroborusmovement.com/flas...tResizable.fla

Any help would be greatly appreciated

View Replies !    View Related
Moving A Graphic Is A Circle Using Actionscript
How do I make a graphic move in a circle using actionscript??

View Replies !    View Related
Simple Left To Right Moving Graphic
Hi Flashers

I'm after a very very simple thing but alas I'm not too hot on the old action script side of flash, still learning...

okay, i have a stage size 600x 90 and i have a movie clip that i want to move from the left of this to the right but without using the tween function in flash, instead I'm wanting to do this with code as to save file size...

Any simple ideas?

Many thanks

Tasvin

View Replies !    View Related
Moving Graphic With A Scroll Button
Hi all,

I have been trying to make a button to control a graphic (to make the graphic scroll up and down) but i couldn't do so... I've seen and tried out the ones in the turorial but somehow they didn't seem to work.

Right now i can only let them scroll up but my script only allow the graphic to scroll once at a time (which meant the user need to have a lot of clicking to do) and the graphic cant stop when they ended (which meant the graphic will keep going upwards and not stop at a position that i wanted them to stop)

Can anyone please help.
Thks a lot

View Replies !    View Related
Moving A Graphic Or Movie Clip With Actionscript
Hey,
I imported a movie clip using the loadMovie command but I want to use actionscript to move it from (0,0) to (189,0) at 1px/ms intervals. Instead of using a tween how can I do this with AS? I want the motion to be visible too, not like a while statement.

Thanks.

View Replies !    View Related
Moving The Postion Of "Falling Snow" Into Another Graphic
I am having trouble with the Falling Snow tutorial. I would like to move the instance of the snow inside another graphic on the stage but no matter where I drag the snow instance or change the x any y postioniong of the snow instance on the property inspector, I still get the snow at the default position, the top left corner of the mc.

If anyone can help it would be greatly appreciated.



Thanks,

Statiicviisiion

View Replies !    View Related
Moving The Postion Of "Falling Snow" Into Another Graphic
I am having trouble with the Falling Snow tutorial. I would like to move the instance of the snow inside another graphic on the stage but no matter where I drag the snow instance or change the x any y postioniong of the snow instance on the property inspector, I still get the snow at the default position, the top left corner of the mc.

If anyone can help it would be greatly appreciated.



Thanks,

Statiicviisiion

View Replies !    View Related
Fancy Box Type Moving Graphic Type Cool Efect But Im To Dumb Type Thingy
i am tring to make a box thinky simaler to the one on www.starvingeyes.com but cant even work out how to start it. is there anyone who can point me in the right direction or to a tutorial ?

the box has a graphic inside a grided box the sections of the graphic fade in and out as the mouse goes over them and displays random sections when the user is not moving the mouse over the box

i did find java tutorials for this effect but would much preffer it to come from flash as java is a bugger to get working on some machines

Any way thanks in advance for any help

Steven Green one_mad_punk@yahoo.co.uk

View Replies !    View Related
Unknown Fx Name
Hi, i need to do an effect i remember i saw the tutorial on virtual-fx but i see its not working does anyone knows where i can find that effect that for example you got an interface with 5 buttons and if you hit 4 you see 1 - 2 - 3 move left or right ttil you get to 4 and if you click 2 you see 3 pass ttil you go to 2 ill appreciate any tutorial or fla file thanks a lot.

View Replies !    View Related
Unknown Variable
Using a load variables from a txt file I have my swf file load a text file that I am unable to change and is not in the "name=Jon&Age=5" format. When I load it the variable name contains the information I need as a variable. So the variable name is
name_jon%age_5% and the variable is something like 1200023
and a lode of other rubish.

What I need is to be able to call a unknown variable name and split it in to some variables.

Hope you can help.

View Replies !    View Related
Unknown Solution?
Hi,
I have a Movie-Clip in my Library with a layer for the Action Script.
In the first frame The Action Script is a one function that will do some stuff to my objects, set colors, do some random stuff and more...

two scenarios :
1) I have a button in the main scene, that on-click will attach the Movie from the library, and then will call the function that placed on the first frame.

---> NOT WORKING! it creates the MC but the function is not being called!


2) I have two buttons in the main scene, on-click on the first button will attach the movie from the library, and the second button will call the function that placed on the first frame.

--> WORKING!!! it will create the MC, on the first button click. it will call the function on the second button click...

WHY does the first scenario is not working, and how can I make it work???

Thanks
Gil Amran

View Replies !    View Related
Unknown Solution?
Hi,
I have a Movie-Clip in my Library with a layer for the Action Script.
In the first frame The Action Script is a one function that will do some stuff to my objects, set colors, do some random stuff and more...

two scenarios :
1) I have a button in the main scene, that on-click will attach the Movie from the library, and then will call the function that placed on the first frame.

---> NOT WORKING! it creates the MC but the function is not being called!


2) I have two buttons in the main scene, on-click on the first button will attach the movie from the library, and the second button will call the function that placed on the first frame.

--> WORKING!!! it will create the MC, on the first button click. it will call the function on the second button click...

WHY does the first scenario is not working, and how can I make it work???

Thanks
Gil Amran

View Replies !    View Related
Unknown Solution?
Hi,
I have a Movie-Clip in my Library with a layer for the Action Script.
In the first frame The Action Script is a one function that will do some stuff to my objects, set colors, do some random stuff and more...

two scenarios :
1) I have a button in the main scene, that on-click will attach the Movie from the library, and then will call the function that placed on the first frame.

---> NOT WORKING! it creates the MC but the function is not being called!


2) I have two buttons in the main scene, on-click on the first button will attach the movie from the library, and the second button will call the function that placed on the first frame.

--> WORKING!!! it will create the MC, on the first button click. it will call the function on the second button click...

WHY does the first scenario is not working, and how can I make it work???

Thanks
Gil Amran

View Replies !    View Related
Unknown Error
Hey guys i have been trying to make this file to work for the last week but everyting i do is making it go spastic. When the preload bar goes to 100% it then goes into the game were if u move ur mouse goes left the blue and yellow dots go to the right and so on for right and up and down. I have been trying to make it so that after 15 seconds has passed the game (dots ete) will fade out to another black background (a new scene) were i can fade in some text and a button. Any ideas.? please look at the attach ment for further understanding

View Replies !    View Related
Unknown Problem
I ran into something ive never seen my flash mx do before, and i wanted to know if anybody knows what happened.

I was making a flash movie, and around the 750th frame(in test movie screen) my sound effects and animation started to go out of sync. The sounds started to go before the animation did, even though they were perfectly lined up in the timeline. I had to move all my sounds down like 50 frames or so, just so they would match the animation when the movie was exported.

Does anybody know what happened? It's unknown to me.

View Replies !    View Related
Unknown .swf File
I recently found a file on my computer called "logger.swf" i used a decompiler to find out what was in it, and i'm not sure what the code means. I'm worried it might be a malicious file but i'm not sure. So if anyone can tell me what this code does i'd be very thankful.

This is part of the file so if you need more of the code to tell what it is just tell me.



Code:
onClipEvent (initialize)
{
_type = "Dynamic";
_text = "";
font = "_sans";
fontSize = 10;
_textColor = 0;
_border = true;
_borderType = "normal";
_background = true;
_borderColor = 12303279;
_bevelColor = 14803416;
_backgroundColor = 16250870;
scrollLocation = "both";
_multiline = false;
_password = false;
_wordWrap = false;
fieldIcon = "ftf_errorIcon";
showFieldIcon = false;
enabled = true;
}

// [Action in Frame 1]
Stage.align = "TL";
Stage.scaleMode = "noScale";
var stageListener = new Object();
stageListener.onResize = function ()
{
_root.log.setSize(Stage.width, Stage.height);
};
Stage.addListener(stageListener);
stageListener.onResize();
var conn = new LocalConnection();
conn.log = function (txt)
{
_root.log.text = _root.log.text + (new Date().toString() + ":" + txt + "
");
};
conn.connect("logger");
var test = new LocalConnection();

View Replies !    View Related
[F8] Unknown Array
Ok, the thing i would like to do is this:

set ("player" + i + "name", "The Great1")

From what i read this creates/modifies a variable using this expression, The problem is what i want to do is modify an array. In the script i already know the index/element i want to change but i dont know the name of the array it belongs to.

Can i use a script with expression like this to do the same thing?

Thanks for any help.

View Replies !    View Related
Instance Name Unknown Now
could someone please tell me how to find the new instance name after the following attachMovie statement?


Code:
nMovie = attachMovie("pagepalIMG","friend"+bStr.substr((bStr.length-1),bStr.length),this[fImage][fImage0].getDepth(),{_x:this[fImage][fImage0]._x, _y:this[fImage][fImage0]._y});

View Replies !    View Related
Enter - The Unknown
The first frame of the movie I am working on has a sort of splash screen. In the center is a button. The idea is whent he movie first starts, the movie stops until the person click the button to continue playing. The button also sets some data in varibles needed later on in the movie. My problem is that for some reason pressing Enter causes the movie to play without triggering the button. There are no other buttons in the movie, so its not like focus is on soemthing else causing it to play. Anyone know what's causing this?

View Replies !    View Related
Unknown Problem
I started learning actionscript yesterday, so bare with me....

I want to make it so that if certain movies collide with another movie, it will go to a certain frame in a movie and subtract a certain number from a counter:

this.onEnterFrame = function() {
if (_root.ball_mc.missle_mc.hitTest(_root.enemy._x, _root.enemy._y)) {
_root.ball_mc.gotoAndPlay("key");
_root.enemy.enemyhealth -=3;
};
if (_root.ball_mc.bomb_mc.hitTest(_root.enemy._x, _root.enemy._y)) {
_root.ball_mc.gotoAndPlay("key");
_root.enemy.enemyhealth -=5;
};
if (_root.ball_mc.s_mc.hitTest(_root.enemy._x, _root.enemy._y)) {
_root.ball_mc.gotoAndPlay("key");
_root.enemy.enemyhealth -=1;
};
}

this is my code. The first part says if the movie "missle_mc" (which is inside ball_mc) hits the movie "enemy" than the movie "ball_mc" will go to frame "key" and the counter varnamed "enemyhealth" will subtract 3 from its counter. This first one works perfectly, but the other two, where i have changed the amount to subtract and the the object that hits the "enemy", dont work. What could possibly be wrong? If you need to see the flash i can put up a link...

I'de appreciate any help i can get since i know almost nuthing about actionscript. Thanks.

View Replies !    View Related
Unknown Pageurl
Hi,
I am connecting to FMS on Parallels through Mamp on my Mac. In the allowDomains files I have placed the exact url and even the ip address for where MAMP serves the applications on my Mac. Yet I still get "Unknown Url -

View Replies !    View Related
Unknown Collapse
I am doing a proyect that use several movie clips, each one with a rollOver event. When I move the mouse pointer really fast over many movieclips the movie collapse. Somebody knows how to fix the problem? I don't know what to do.

View Replies !    View Related
AS Unknown Error
im creating one of my first platformer games. i have finally perfect my engine, except for one thing. for an unknown reason i cant get the following bit of coding to work.
onClipEvent (enterFrame) {
if (Key.isDown(key.DOWN)) && (_root.ground.hitTest(_x, _y, false) {
this.gotoAndStop(5);
}
this is so when my guy crouches, if hes not touching the ground(is airborn) then he wont crouch he will just go back to the falling frame(animation) but for an unknown reason to me flash wont accept the "&&" function, and says its "unexpected" please help. (i am using flash 8, AS 2.0)

View Replies !    View Related
Tween The Unknown(s)
I want to us AS to animate a series of dynamically created MovieClips, one after the other. Here's the catch, I can't hardcode the tweens because the target and number of targets will always change. Has anyone sucessfully pulled this off? I've checked previous posts but it seems like people with a similar problem have gone unanswered. Please, a little guidance for a humble noob.

View Replies !    View Related
Unknown Font
Can anyone tell me the font used for the title screen of the Flash tutorial, "Creating Animated Buttons"? I'm guessing it's a Flash pixel font, but I can't seem to find out which one it is.

View Replies !    View Related
Known Bug Of Flash... Or Unknown Bug Of My Brain?
I need help please... this is driving me crazy!!!

The problem is that I have a set of movie clips which must send messages one to another. For example, when movie clip A reach frame 10, send a message to movie clip B to play from frame 15... easy, uh?

I did it with "_root.instanceB.gotoAndPlay(15) " on frame 10 of the clip A, and it works fine, but then I change the "deepness" of instance B (I donīt Know how to say it in english, I hope you understand, when you put an instance over another one) and CRASH!!... instance B donīt recognise the "_root.instanceB.gotoAndPlay(15) "!!

If someone can help me, or speak spanish (my english is very very bad ), please I really need it!!

View Replies !    View Related
Unknown Crypkey Error
i continue to get this error when i try to open swish for the first time. i have never used this software before so im not to sure what is wrong. i have a trial version that i downloaded and installed including the update. when i try to run it i get this error....

There was an unknown CrypKey error. Restart the program and try again.

i don't know if there is something i should download or not. do i have to edit my autoexec files?

View Replies !    View Related
MC Stops For Unknown Reason
Hello all,

This is driving me crazy. I have used this script before with no problems but.......


I have an empty movie clip that has this on frame 5:

if (_parent._x < 292) {
difference = 292-_parent._x;
rate = difference/2;
_parent._x = _parent._x+rate;
}

It makes its parent clip move to the right.

The next frame has this:

if (_parent._x < 292) {
gotoAndPlay(5);
}

This should check to make sure it has made it to the spot that it needs to be in. Then it should move on down the line.


My problem is that it doesnt move on. the motion works perfectly but the MC seems to stop here. Anyone ever have this problem? I have been messing with it for the last three hours. Your input would be greatly appreciated.

-Regards

View Replies !    View Related
Loading Unknown Var Names
Hi!

I'm using some php to checkout what files/folders are in a certain directory, I want to output that to flash, which is cool.. but how can I do something with these var names? they are unexpected to flash.

can I do it without using xml as well

View Replies !    View Related
Unknown Data Length
Hi,

I am looking for a dynamic method to handle imported data of unknown length and put it into an array of a specified length. Since the data length is unknown, the creation of the arrays to hold the data needs to be dynamic as well. I'm not quite sure how to approach that. For ease of explanation, lets say I have an array of 200 items and I need arrays populated with a length of 10. I need to create 20 dynamic arrays to hold the data. So far, in a quick test I used a simple for loop to handle the data being pushed into predefined arrays like this...
code:
var count:Number = 2;
importedData = ["item1", "item2", "item3", "item4", "item5","item6", "item7", "item8", "item9", "item10"];
myItems2 = [];
myItems3 = [];
function arrLoad() {
for (var i = 0; i < count; i++) {
myItems2.push(importedData[i]);
}
for (var j = 0; j < count; j++) {
myItems3.push(importedData[j + count]);
}
trace("Item2 array=" + myItems2.sort());
trace("Item3 array=" + myItems3.sort());
}
arrLoad();

Any better suggestions?

Thanks in advance
NTD

View Replies !    View Related
Unknown Actionscript Problem
I have a website that has a menu page with 4 movie clip buttons on it named work_mc, behold_mc, corner_mc, and personal_mc. Inside these movieclip buttons, there is an animation that will play whenever the user mouse's over one of the 4 movie clip buttons. The animation has lines that will either move close or further apart based on the use staying on the button. It is basically a set of brackets that move closer when the user mouses over or moves further out when the user mouse's off.

The problem I am having is it works fine with a high speed connection but on slower speeds the 4 movie clip buttons dont appear until about 30 seconds to a minute after the preloader has finished. At first I thought it was the preloader but I am able to see the menu background picture so I know it is getting to frame 2. Any help would be greatly appreciated.

Thanks... Ernest

// Stop for the preloader
stop();

// Preloader Code
checkProgress = setInterval(getPercent,10);

function getPercent() {
var currentBytes = _root.getBytesLoaded();
var totalBytes = _root.getBytesTotal();
var pctLoaded = Math.round(currentBytes/totalBytes*100);
loaderbar_mc._xscale = pctLoaded;
loader_txt.text = pctLoaded;
if (pctLoaded >= 100) {
gotoAndStop(2);
clearInterval(checkProgress);
}
}

_root.onEnterFrame = function() {

// Page locations for buttons
_root.work_mc.hit_mc.onRelease = function() {
getURL("../career/", "_self");
}
_root.beholder_mc.hit_mc.onRelease = function() {
getURL("../model/");
}
_root.corner_mc.hit_mc.onRelease = function() {
getURL("../corner/", "_self");
}
_root.personal_mc.hit_mc.onRelease = function() {
getURL("../news/");
}

// Code for the "Life's Work" button
if (_root.work_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
if (_root.work_mc._currentframe < _root.work_mc._totalframes) {
_root.work_mc.nextFrame();
}
} else {
if (_root.work_mc._currentframe > 1) {
_root.work_mc.prevFrame();
}
}

// Code for the "Eye of the Beholder" button
if (_root.beholder_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
if (_root.beholder_mc._currentframe < _root.beholder_mc._totalframes) {
_root.beholder_mc.nextFrame();
}
} else {
if (_root.beholder_mc._currentframe > 1) {
_root.beholder_mc.prevFrame();
}
}

// Code for the "Ruffa's Corner" button
if (_root.corner_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
if (_root.corner_mc._currentframe < _root.corner_mc._totalframes) {
_root.corner_mc.nextFrame();
}
} else {
if (_root.corner_mc._currentframe > 1) {
_root.corner_mc.prevFrame();
}
}

// Code for the "Getting Personal" button
if (_root.personal_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
if (_root.personal_mc._currentframe < _root.personal_mc._totalframes) {
_root.personal_mc.nextFrame();
}
} else {
if (_root.personal_mc._currentframe > 1) {
_root.personal_mc.prevFrame();
}
}
}

View Replies !    View Related
Listener Broadcast From Unknown Mc
I am building a mc with a button in it and some action. There will be several of these placed on the main timeline. However I will not know how many nor will I know there names. When the button is pressed a box is opened in that mc. What I need is to be able to close the box if it is open in another instance of that mc. I have been trying to figure this listener thing to do it but it seems that it needs to be defined. You can see somehting like I am doing here http://www.marines.com/page/usmc.jsp?flashRedirect=true Click on any of the images and you will see orange squares (buttons). any help would be great thanx.

View Replies !    View Related
[F8] Unknown Error With OOP Script
Hey guys, I'm sure youll look at this script and just laugh at some bad mistake ive made, but ive been trying to learn OOP and this is my first script.

Anywhoo can you guys tell me what ive done wrong? I really wanna grasp this.

cheers

OK

so I have a main file called turretfollow with this code
Below, i have a movieclip called guns in the library to attach to the movieclip i make which works fine.

Code:
import FollowMouse.as;
for(i=0;i<10;i++){
_root.createEmptyMovieClip("turret"+i, _root.getNextHighestDepth());
_root["turret"+i].attachMovie("guns", "guns2", _root.getNextHighestDepth());
_root["turret"+i]._x = random(450)+40;
_root["turret"+i]._y = random(325)+40;
}
_root.onEnterFrame = function(){
for(j=0;j<10;j++){
_root["turret"+j] = new FollowMouse();
_root["turret"+j].SetRotation();
}
}
And then, I have an external AS class file called FollowMouse

Code:
class FollowMouse extends MovieClip {
var opp;
var adj;
var angle;
function FollowMouse(){
}
function SetRotation(angle:Number){
opp = _root._ymouse - _y;
adj = _root._xmouse - _x;
angle = Math.atan2(opp, adj);
angle /= (Math.PI/180);
_rotation = angle;
}
}
I get an error saying the class followMouse cannot be loaded in my fla file. Also, when it was working somehwat, it would make the movieclips but it owuldnt run the setRotation method.

Please advise.

Aaron

View Replies !    View Related
Trying To Target Unknown Named Mcs In AS2
Hi,
I am working a bit backwards here from AS3 to AS2. Does anyone know how to target a mc in AS2 as i would in AS3 like so:

movieClip.getChildAt(depth);

I will also need to find the total number of children in a movieclip so that i can loop through that clip x amount of times.

movieClip.numChildren


I can't remember this AS2 method or find any posts

thanks

View Replies !    View Related
Inherited Singleton - New Unknown();
Hi,
I am sooo stuck on this thing. I can't find any directions in any of my books, helpfiles, google or in these forums.

I am doing a remoting site and want all my "remoting classes" to inherit a superclass where I can set the service name, Event handling and a few other common things. One thing I want if that each of them be a Singleton. I just can't figure out how to instantiate an "unknown" class.

Putting the Singleton code in the superclass: what do I do to find the constructor? _instance = new ????()

How does code in a superclass know the name of the class it is before instantiation? Is it not possible in Actionscript?

Thanks in advance to anyone with an answer.

Here is my code with "__CLASS__" where I can't figure out how to access the class name.



Code:
import mx.remoting.*;
import mx.rpc.*;
import mx.utils.Delegate;
import mx.remoting.debug.NetDebug;
//Event Dispatcher imports
import mx.events.EventDispatcher;

class AppController
{
private static var _instance:AppController = null;
// Event Dispatcher members
public var addEventListener:Function;
public var removeEventListener:Function;
public var dispatchEvent:Function;
//Change the gateway URL as needed
private var gatewayUrl:String = "http://search.site/gateway.php";
private var service:Service;

private function AppController()
{
EventDispatcher.initialize(this);
NetDebug.initialize();
this.service = new Service(this.gatewayUrl, null, __CLASS__.name+"Controller");
}

public static function getInstance()
{
if (_instance == null)
{
_instance = new __CLASS__();
}
return _instance;
}
}

View Replies !    View Related
Possible To Have HitTest On Object Of Unknown Name?
My question is, is it possible to have a hitTest on an object that you don't know the name?

For instance:

Say you create 100 movie clips and then some of them are destroyed. Would there be a way to check hitTest for just the ones that are still there? Is there a way to just see if something hits something and then find out what was hit?

Thanks,

View Replies !    View Related
Copyright Đ 2005-08 www.BigResource.com, All rights reserved