ActionScript 2.0 :: Make MC's Unabe To Pass Eachother
Aug 4, 2006
I have 2 objects, a bouncing ball and a barrier. How do i make it so that the ball may not pass the barrier? It seems that no matter what I do, there are circumstances in which the ball does pass the barrier.
View 14 Replies
Similar Posts:
Oct 11, 2009
I have a MC (a ball) with this AS on it:
[Code]...
This bounces the ball off each 'wall'. how to add more balls (using actionscript - ie not copying and pasting on the stage) and to make the balls bounce off eachother too?
View 1 Replies
Oct 19, 2004
I have a number of random balls bouncing around the stage. What I am having difficulty with is making them bounce off each other when they run into each other. The balls bounce off the walls just fine, but I can't seem to figure out the hitTest thing.
View 3 Replies
Feb 25, 2012
I'm trying to eventually reach an end result in which you control an object with your mouse (which has worked so far) and other objects on the stage gravitate towards you as you move near them, just like they would in real life with physics and whatnot in space. Basically at the moment I'm just trying it with a single object gravitating towards an object anchored to the cursor. It is sort of working, but not really, when the x and y positions of object2 get near those of object1 it breaks and flips everywhere.
Here is my code thus far:
ActionScript Code:
onEnterFrame = function (){
Mouse.hide();
startDrag(atom,true);
[code]....
note the ax and ay variables could be avoided entirely probably and you could just do atom2._x -= 1 / dx; but i had created them when experimenting earlier and left them.It is very important that the object accelerates as it gets closer to the cursor, and that it is hardly affected when it is far away (again just like it would be in space).
View 0 Replies
Jun 8, 2007
I've got a function here that spawns an enemy for me and I'm calling it in a loop every few seconds or so that it creates a new enemy every second. This all works great.What I want to do though, is to make the enemies collide with each other. How would I go about doing this? I've tried using hitTestm but it detects that each enemy is hitting itself which is always.I've attached my code.
View 2 Replies
Aug 26, 2004
at the end of this tutorial it talks about adding links to the buttons created. I did what it said to do but the two buttons keep canceling themselves out if I place them on top of eachother.
View 1 Replies
Jul 13, 2009
I want a xml gallery with all the pictures visible and stacked on top eachother. And i also want to make every picture buttons s you can click on a picture and go to the html page with a big picture. is this possible and can someone help me with the code?
View 1 Replies
Jan 20, 2005
Im using MediaPlayback-component to load MP3-files into and play them.
I use this code to call it:
myMediaPlay.setMedia("SOUND.mp3", "MP3");
myMediaPlay.play(0);
Problem is that the sound is played twice overlapping eachother (some of the mp3 is played first,interrupted, and then restarted again to finish fully).
View 4 Replies
Jan 16, 2011
I'm running a HitTestPoint to detect when two of my mc's collide, but I don't want them to be able to go right through each other. Someone suggested I find the x,y coords of the moving object when the collision occurs, then update that mc's coords to this x,y each time a collision occurs. I've been Googling but came up empty. Below is my code
private function __checkHit($evt:Event):void {
if (this.coin_mc.hitTestObject(target)) {
if (!hitting) {[code].....
View 2 Replies
Mar 30, 2010
I want ask u how can i create hitTest function that when two mcs from movieC array hits eachother they can change their colour. Both of them.
View 3 Replies
Jan 11, 2011
i want to create instance of mxml (in my case EventList) and pass parameters. My Event List is a list of panels so I want to pass parameters and generate dynamically n number of panels (n-parameter to pass). I have the main app where I have toggle button bar when I click on the first I want for example to generate 3 panels (n=3) on the second button 20 panels (n=20) etc.How can I do this? How can I pass n and what is the best way to show the list? I whant to generate the list when I click on the toggle button!
View 1 Replies
Aug 12, 2009
So I'm loading a variable into my .swf from PHP (using loadVars) and adding two loaded variables together. However, when they are added they "add on" to eachother.
Example:
varOne = 1
varTwo = 3
varOne + VarTwo = 13 (????)
I was thinking the variable may think it's a string, but I don't know how to declare the variables sent in from PHP.
[code]...
View 1 Replies
Mar 2, 2007
why wont this work?
some_mc["nested_mc_name"].onPress = function():Void {
trace ("test")
};
I'm trying to make a dynamic function so I can pass a string var for the name of any nested movieClip I want on the fly.
View 1 Replies
Oct 28, 2009
I'm having to pass data (originally read via an XML file loaded by the parent class) to a child class upon instantiation, and I can't decide which is the better method.I could parse the XML in the parent and throw the data into an Object and pass that object to the child class....or just pass the part it needs as an XMLList and let the child class do the parsing.Seems like a trivial decision, yes, but I'm not sure of longer-term implications.
View 3 Replies
Apr 6, 2008
Trying to pass a variable as well and cant seem to escape to pass it. How can I pass using window.open as such: Trying to pass (pid) all i get back is (pid) and not actual pid.How to on a jscommand?
Code:
something.onRelease = function () {
var jscommand:String = "window.open('http://www.someform.php?proj= + (pid)','win','height=200,width=300,toolbar=no,scrollbars=yes');"; getURL("javascript:" + jscommand + " void(0);"); }
I can do a standard getUrl("http://www.someform.php?proj=" + (pid), "_blank"); works fine but no control over window properties.
View 1 Replies
Jan 23, 2011
I'm using CS5 and I'm trying to pass 2 values from ASP to Flash. I can pass one value, but not 2.
Here's the ASP:
Code:
stranswer = "success=yes"
strresponse = "responsestatus=MESSAGE FROM ASP"
Response.Write (stranswer)
[code]....
The way the function is coded I get a Failed response or nothing happens at all.
View 2 Replies
Aug 21, 2011
Whats the best most correct or professional (less chances of error or most efficient) way of sending a var from php to a swf container and then to a swf that is loaded with the loader class from the container?
View 7 Replies
Dec 27, 2011
i have 2 swf one.swf and two.swf, so i just want to pass value one.swf to two.swf.
View 9 Replies
Feb 1, 2010
In the past I have created a php file that generates the XML and then referenced it in place of the xml file and it has worked. I am trying this with a precompiled flash app and it is not working.
It works if I run the script, save it and then reference that file to the swf. I would rather not generate a file to the filesystem if possible. Anyone any solutions?
View 4 Replies
May 30, 2011
i am new to the flash . Just i want to how to pass values from Flash variable to php
i am using this code
[Code]....
Warning: 1060: Migration issue: The method LoadVars is no longer supported. For more information, see the URLVariables class, the URLRequest.urlVariables and URLRequest.postData properties, and the URLLoader.dataFormat property.
View 1 Replies
Sep 23, 2011
I have a two swf, index and gallery. I am call gallery.swf in to index.swf.
loadMovie("image_gallery/gallery.swf",1);
I want to make pass value from gallery.swf.
View 1 Replies
Dec 29, 2011
i hv 1.swf and i call 2.swf from 1.swf.. now in 1.swf there is one variable Var_data, now i set value "Hello World" in Var_data and then after i call 2.swf and on 2.swf frame 1 i print Var_data value but it's not display aything
Code of 1.swf
sending_lc = new LocalConnection();
var Var_data = "Hello World";
sending_lc.send("my_lc_as2", "execute_this", Var_data);
[Code].....
View 2 Replies
Feb 12, 2004
I have this little quiz I made in flash and it's a movie clip. Now I have a variable (score) that I use to tally up the score. What I'm trying to do next is tell ANOTHER movie clip that if the score is a certain number, play a certain frame in the NEW movie clip. So how do I pass that variable from the one movie clip to another movie clip and tell that clip to play at a certain frame if score=x?
View 2 Replies
Feb 6, 2009
I have a swf with an input text box and a button. When the button is clicked, i need it to open another swf in a new window and pass the variables to a text box in the new window.
View 3 Replies
Nov 12, 2009
can i pass variable from one swf to another swf. each swf is in separate html page.
View 3 Replies
Feb 12, 2004
so I have this little quiz I made in flash and it's a movie clip. Now I have a variable (score) that I use to tally up the score. What I'm trying to do next is tell ANOTHER movie clip that if the score is a certain number, play a certain frame in the NEW movie clip.Right? So how do I pass that variable from the one movie clip to another movie clip and tell that clip to play at a certain frame if score=x?
View 2 Replies
Mar 23, 2009
I am able to pass a variable from an html link that loads a separate html file and instructs the embedded file to go to a specific frame. But - I now need a link within an swf file on one page to open a new page and tell that swf to start on a specific frame and it is not working. Here is the code I use for the first example - works like a champ:
[Code]....
View 1 Replies
Sep 12, 2009
I am trying to develop a basic game engine for a slime soccer style game where a player can move around and jump. I am still fairly new at AS3 but managed to put together this working bit of code that the game currently runs on:
Code:
stop();
//vardefs
var runSpeed:Number = 10;
var blueGoals:Number = 0;
var redGoals:Number = 0;
[Code]...
View 4 Replies
Dec 2, 2010
I have a movieclip acting as a button with a dynamic textbox inside. The text is being passed via a xml and it has a URL associated with it. But the link does not work. When I remove the onRollOver action that makes my mc button show a rollover state the link works. But when the rollover is active it doesn't.
If there's a way to pass the URL via xml to the button, instead of the text inside the button, that would also be good. (even better because that way the whole button would link, and not just the text)
View 2 Replies
Aug 2, 2011
learn how to pass a var from flex application to a swf file that is on my server?
Actionscript Code:
<?xml version="1.0" encoding="utf-8"?><s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
[code].....
View 3 Replies