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




Question On On (Release) Reaction



please see this site: http://www.hangar17.net/hxvii/hx.asp

when you press on contact, about, work, etc, there will be a button right at the bottom that will lead you back to the front og the flash movie.

How does the button at the bottom react when you press on the menu buttons? ( as soon as you go to an info section, the bottom button will appear as "back")



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 01-12-2004, 05:04 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Question On On (Release) Reaction
please see this site: http://www.hangar17.net/hxvii/hx.asp

when you press on contact, about, work, etc, there will be a button right at the bottom that will lead you back to the front og the flash movie.

How does the button at the bottom react when you press on the menu buttons? ( as soon as you go to an info section, the bottom button will appear as "back")

Slow Reaction On Button Release?
I am having reaction issues when a button is pressed. I have my main .swf with a MC placeholder that loads external .swf's. The button release passes a variable that moves the external .swf's timeline to the outro transition. My problem is, when I click a button I have to wait ten seconds sometimes before it passes the variable and starts the outro transition. The outro keyframe is the start of the outro transition, so there is no timeline progression to slow it up.

To see an example of this: http://www.conspirator.org/test2.htm. Select Conspirator let it load, then try clicking Tour to see the slow reaction usually many seconds.

Here is my buttion Actionscript.

on (release) {
if (_root.currMovie == undefined){
_root.currMovie = "tour";
container.loadMovie("tour.swf");
}else if(_root.currMovie !="tour"){
//if(container._currentframe<=container.midframe){
_root.currMovie = "tour";
container.play();
}
//}
}

Any ideas? I don't see why if the external .swf is loaded there should be any reaction time.

thanks. j

No Reaction To Changes?
First of all - i'm neither drunk or crazy.
But i have a strange problem that haunts me once in a while. Not in a regular pattern or anything that could help to identify the solution.

When I test my project changes simply doesn't get recompiled. Eventually it helps to "destroy" some actionscript by deleting some lines of code thus provoking an error. Otherwise i had luck recompling the project by deleting the .swf files. But again - this is not a perfect solution and usually not a solution at all.

Anyone having the same type of problems?

And what's your magic trick?

Thanks in advance,

From With MC Reaction To Variables
lemme explain wuts goin on here, i got a health bar that should display the % of the currentHP/fullHP. this is the code i got for that

onClipEvent(enterFrame){
_root.hpBar.gotoAndStop(currentHP/fullHP*100);
}

if works of the first frame but when actions occur that alter the currentHP variable it doesnt react, and i got the stage goin back between to frames so the enterFrame action will work. both of the variables r globals, so thers no question as to whether they're being targeted rite. any ideas wuts wrong?

Reaction Time
I am making a drag r, christmas tree, and I need a scrip to show reaction time, after the green light.

Can anyone help?I tried searching but couldnt find anything.

Thanks

Trigger Reaction
ok i created the following fla in hopes to get each movie clip that is hit to play, so i used the trace function to see what works and I used this scripting
code:
this.onLoad = function() {
for (i=0; i<150; i++) {
duplicateMovieClip("ball", "ball"+i, i);
}
};
// the following for loop doesn't work when trying to use to play mcs;-_-;
this.onEnterFrame = function() {
for (i=0; i<150; i++) {
if(this["ball"+[i]].hitTest(this["ball"+[i]])&&(this["ball"+[i]]._currentframe == 7)) {
trace(this["ball"+[i]]);
}
}
};

and whatever ball is hit when another ball is exploding(animation caused by clicking ball, it traces the balls name, but when i try to say
code:
this["ball"+[i]].play();
//instead of
trace(this["ball"+[i]]);

I get no results, any suggestions??

HitTest() No Reaction...
Hello,

I'm completely novice when it comes to ActionScript. I have done a tiny bit of programming before, but that was ages ago.

My problem is: When my avatar-movie-clip hits the house-movie-clip I want a new frame with a movie-clip to start playing. On my avatar-movie-clip I've got the following code:

"

onClipEvent (enterFrame) {
if (_root.avatar_mc.hitTest (_root.hus2) )//==true)
{
//gotoAndPlay(2);
trace ("house2");
}

if (_root.avatar_mc.hitTest (_root.hus4) )//==true)
{
//gotoAndPlay(3);
trace ("house4");
}


//if (_root.avatar_mc.hitTest (_root.wall) ==true) {
// _x=_x-2;
// }
}



on(keyPress "<Left>") {
this._x = this._x -5;
this.gotoAndStop(2);
}
on(keyPress "<Right>") {
this._x = this._x +5;
this.gotoAndStop(4);
}
on(keyPress "<Up>") {
this._y = this._y -5;
this.gotoAndStop(3);
}

on(keyPress "<Down>") {
this._y = this._y + 5;
this.gotoAndStop(1);
}


"

As you can see I'm testing the action with a trace-function as I cannot get it working with the gotoAndPlay/Stop() function. That's works perfectly fine. The msg-box with either "house2" or "house4" displays when the avatar hits each house.


Can somebody please tell me why this won't work? Find this very frustrating..

OnLoadProgress Has No Reaction
Hey, does anyone have an idea why the trace at onLoadProgress here doesn't trace at all?

ActionScript Code:
xLoadVisual = function (Src, Targ) {
    my_mcl = new MovieClipLoader();
    var my_listener:Object = new Object();
    my_mcl.addListener(my_listener);
    my_listener.onLoadStart = function() {
        trace("Load started");
    };
// this one, I mean :
    my_listener.onLoadProgress = function() {
        trace("Load in Progress");
    };
    my_listener.onLoadComplete = function() {
        trace("Load complete");
    };
    my_listener.onLoadInit = function() {
        trace("Loaded and initiated");
              my_mcl.removeListener(my_listener);
    };
    my_mcl.loadClip(Src, Targ);
};
xLoadVisual = function("my.jpg", _root.my_mc)

Chain Reaction
++++++++++
++++++++++
++++++++++
++++++++++
++++++++++
++++++++++

imagine this as grid of MC
know u choose one and click (random choice)
the one u click (+) become (-) and the others will follow the first by order of proximity.
I'm looking for some solution for this problem, how can I get MC to talk to each other?!

"hey! did the user click on you bro?, should I react now?!"

Tooltip Reaction Help
Please go to my website http://www.timdeneau.com/ and look at the button labeled sculpture. What I'm trying to achieve is a tooltip effect, and this is the code for my button so far:


Code:
on (rollOver) {
this.gotoAndPlay("start_hover");
interval_01bubble01 = setInterval(function_01bubble01, 1000);
function function_01bubble01() {
_root.mc_menu.mc_selection.mc_01bubble01.gotoAndPlay("start");
clearInterval(interval_01bubble01);
}
}
on (rollOut) {
this.gotoAndPlay("stop_hover");
_root.mc_menu.mc_selection.mc_01bubble01.gotoAndPlay("stop");
}
on (press) {
_root.mc_menu.mc_selection.mc_01status01.gotoAndPlay("start_load");
interval_01option01 = setInterval(function_01option01, 1000);
function function_01option01() {
_root.mc_content.loadMovie("girl.swf");
clearInterval(interval_01option01);
}
}
So it works fine if the user were to be perfect and hover over the button, press it, wait a second and then lose focus. But if the user just whizes passed the button the tooltip starts to freak out!

I understand the problem is that rollOut is trying to stop the animation before it even has time to start. I just can't figure out what code I would need to remedy this? Any help is appreciated.

Mac's Reaction To Flash
Why?...I'm using a pc to make my flash site...But the macs doesn't recognize them...they're full of glitches and ugly stuf that does not appear on the pc's...why?
<img src=http://www.ezboard.com/intl/aenglish/images/emoticons/ohwell.gif ALT=":">

:eek:

Delayed Reaction With 2 Swf's
The two swf movies on my site are having a delayed reaction with the user's inputs. Will this always have to be this way or are there ways around it?
The search form is especially slow.

Controlled Chain Reaction?
I am handling a dangerous piece of script here: I would like to create some sort of chain reaction where one Mc gets cloned then these two have two other duplicates and so on.

I am struggling with the fact that my code inherited from one MC to the next causes an uncontrolled cloning frenzy. How can I do this in a controlled way without the code crashing on me?

I noticed that a lot of the duplicates carry the same name. How can I prevent this?


Code:
///onload Movieclip
Movieclip.prototype.createDupe=function(Clip){

i=Math.floor(Math.random()*3);


if(_root.Dupe10==undefined){

var thisDupe = Number(Clip._name.substr(4));
newDupe= thisDupe+Direction[i];

///duplicate and name MC Dupe
duplicateMovieClip(Clip,"Dupe"+ newDupe, newDupe);

///put the new dupe in place
_root["Dupe"+ newDupe]._x = _root.Clip._x+XPosition[i];
_root["Dupe"+ newDupe]._y = _root.Clip._x+YPosition[i];

}else{
break;
}

};



Is anybody out there with a genuine idea?

Action - Reaction, Hitzones?
I need some information on how to drag an object, drop it over any other object, i suppose using hitzones (that im not very acquainted with) originating by this a reaction.

*i´ve allready read info/tutorials about hitzones but i didn´t managed with it. Maybe i got to the wrong places.

This a nice simple animation site, that serves as an example for what im aiming to

THANKS IN ADVANCE

enjoy

http://wecomeinpeace.free.fr/

Weird Gotoandplay Reaction...
Hey all, I've got a button on my main timeline with the code:

on (release) {
_root.gotoAndPlay(44);
}

Now, the _root is there because without it, the button did nothing, but with it, the playhead goes to the very beginning of the scene instead of frame 44. Any ideas why this might be happening? thanks!!

Multiple Movieclip Reaction
Hi again all...

Any ideas as to how I can get different movieclips to react differently to mouse movement? I'm thinking of a parralax (?) type effect where if you move the mouse from left to right each item moves at different speeds creating a driving effect i.e. things in the forground move quicker than those in the bg. Imagine looking out of the window of a car, the hills in the backgound barely move but the lamposts fly past quickly... When the mouse stops so does everything else.

Hope this makes sense!

Si

Flash And Music Reaction?
I was wondering if its possible to make animation that reacted to whatever music was being played on the computer...

If anyone has any ideas, please let me know...thnx

***** Very Odd Font Embed Reaction *******
Hey All,

I have a main.swf file loading an outside .swf file. Both files have the same font embedded [dynamic text boxes] but the movie being loaded in won't show a crisp bitmap font.

Verdana 10px

If you play the movie being called in by itself the font is crisp but not when called in a bit fuzzy.

Any ideas? Anyone?

cheers
-jub-

Chemical Reaction In Flash
Hi guys, im pretty new to Flash, and I want some help.

I want to create a chemical reaction in Flash, something like this

http://www.marymount.k12.ny.us/maryn...vreaction.html

I want the molecules split up and join others molecules when the reaction takes place.

Thanks

Mc Instance Synched Reaction
I been having trouble making a second instance of a movieclip react to the same actions (click trigged) of the first instance in synchrony.. does anyone know how to "mirror" the online navigation inside an insance on another instance? Is that possible with as?

I appreciate a lot the help!

^-´-^
D.Loader

Collision Detection & Reaction
Hi there,

I am still developing my asteroids game for flash, and thanks to some very helpful people here i have solved many problems i have been facing. So here i come with another question.

I have used Frame dependant collision reaction rather than hit test as its better. Now this is working to a degree and i am looping through the "circles" which are my asteroids as objects. Now when i get a collision it traces out that there has been a collision and then its meant to remove the movieclip.

however when i shoot an asteroid, it claims there has been a reaction of the other circles... its hard to explain so i have attached the movie to help explain..

Below is the code im working on atm..


PHP Code:



bulletMove = function()
{    
    this.radius = this._width/2;
    for (var i = 1; i<=game.numBalls; ++i) {
        var name:String = "ball"+i;
        
        //trace ("X" + game[name].xpos);
        //trace ("Projectile Position" + this._x);
        var xDiff:Number = this._x - game[name].xpos;
        var yDiff:Number = this._y - game[name].ypos;
        var distance:Number = Math.sqrt(xDiff*xDiff+yDiff*yDiff);
        
            if (distance<=this.radius+game[name].radius) {
                trace("Collision detected!!"+name);
                this.removeMovieClip();
                removeMovieClip(name);
                //_root.[name].removeMovieClip();
            }    
    }
    this._x -= this.xmov;
    this._y -= this.ymov;
    this.life++;
    if (this.life > 10) {
        this.removeMovieClip();
    }    





I hope you can help...thank you very much in advance..

Collision Reaction Of 2 Balls
hi,
i want the collision reaction of 2 balls when they get collide on a stage.
Both are having different masses and speeds. But how to detect the speed of both balls after collision ? and how to detect the collision angle to which they are colliding ?
Please help me .. suggest me any sample of the game.
Thanks in advance.
-soha

How Do I Create A Chain Reaction?
suppose I've got something like this

-----------
var myListener:Object = new Object();
myListener.onKeyDown = function() {
if (Key.getCode() == Key.SPACE) {
icon1_mc.gotoAndStop("frame2");
icon1_mc.gotoAndStop("frame3");
icon1_mc.gotoAndStop("frame1");
}
};
Key.addListener(myListener);
-------------

clearly this wont work because the frames are interfering with each other. What method does a person use to trigger a small sequence of events, such as playing frame 1, then 2, then 3 where it stops, without relying on a preloaded frame sequence?

Slow Reaction Scroller
How do I get the effect of the scroller here?

http://www.jojoonline.co.uk Thanks for your help. Im sure one of the users of this site had a .fla for it in the download part of his/her site? I cant seem to find it now though. Sorry.

Slow Reaction Scroller
How do I get the effect of the scroller here?

http://www.jojoonline.co.uk Thanks for your help. Im sure one of the users of this site had a .fla for it in the download part of his/her site? I cant seem to find it now though. Sorry.

Weird Flash Reaction In IE
This is a really weird case that affects solely Internet Explorer.

We are building a web site with several flash objects. One of the object is a menu and most others are dynamic labels (made in flash to use fancy backgrounds and antialiased fonts) and everything is fine even with several labels. Some of the pages also have flash vector maps that, when displayed, basically break the page loading on IE. If we display only one of the maps, the page stops rendering after the next flash object is displayed (in occurance a dynamic label). If we display two maps, rendering stops either directly after the second map, or in the middle of the second map, it depends. The code is entirely there in the source, IE simply stops rendering the page.

An added bonus is that background images (set in a css) do not load when a flash map is displayed in the page. Other flash objects (like the top menu and dynamic labels) display correctly and everything else above the flash map objects is fine. It seems to be related to the flash movie itself, but I don't see how it's in any way supposed to affect the rendering of the rest of the page in any way.

We can't provide an example as the project is running in a local development environment.

Thanks

AS - AS2 Or AS3 MovieClip Reaction To Mouse
Hi all,

I have been asked to develop a flash movie, which has shapes of the letters of the company name on the stage. Each shape is a separate movieclip and needs to react with the mouse on contact, in such a away like they are made of helium and floating on a string.

For instance pretend when you look at the stage you are looking down and if you hit the movie with the mouse, it moves and rotates in a certain direction and slowly makes its way back.

I have worked out the movement side of things, and just need to work out the rotation. The numbers I have to play with are

The Power of the mouse
The direction of the mouse (degrees)
The angle from the centre of the movieclip the mouse hit.

Am sure am not the first to try this so if there is any help, classes, functions please let me know

Cheers for reading and thanks in advance for any help.

Reaction Issues With Flash CS4
Has anyone using Flash Cs4 noticed issues with reaction times. I run a high spec mac and pc for work, always believe in upgrading my version everytime and I've noticed that compared to Flash 8 its relitively slow in keeping up with me.(I hear you saying, maybe your working that fast its hard for anyone to keep up with you, but thats for another post). Im starting to do most animation work in F8 which I dont think adobe wants. your thought's could prove invaluable to this topic...

Is It Just Me, Or Collision Detection/reaction REALLY HARD?
Hi all,

I've been attempting to make a game for a while now, I've bought Jobe Makar's book and i'm trying to figure out which way up it goes :/ No seriously.. the first bit is OK, but when it gets to collision detection... boy. There must be a clearer way to get through this? Does any body have any advice on where I can learn?

Thanks all,

Andy

Measure A User’s Reaction Time
I’m looking for something to measure a user’s reaction time. Say I had a red dot on the screen and when it changed to green the user would click on a button and display there reaction time to the change in this format 0.000 sec.

Progress Bar Reaction To Dynamically Loaded MP3's
Hey everyone,

I'm having a little issue with some script I have for an MP3 player I'm working on for a site. Realistically, what I want to happen is after the song starts loading, I want the progress bar to track the song's... progress then reset back to 0 and start over for the next song. It works for the first song and then it starts like 50% to 75% of the way thru and then goes invisible (which is what I have it do) here is my code:


Code:
var testingMP3:Sound = new Sound();
var soundDuration:Number = testingMP3.duration;
var soundPosition:Number = testingMP3.position;
progress_mc.onEnterFrame = function() {
var progressAmount = Math.round(((testingMP3.position/testingMP3.duration)*100));
this.gotoAndStop(progressAmount);
if (progressAmount == 100) {
this.gotoAndStop(1);
this._visible = false;
} else {
this._visible = true;
}
};


I figured adding the gotoAndStop(1) would reset my progress bar, and it seems to, but it jumps back up to about 3/4 of the way. Any ideas???

Complicated Chain Reaction Problem
I have a square movie clip that is stationary on the stage and which I want to be solid, or 'rock-like'. Then I have a horizontal wall of small movie clips that are bombs moving down the screen toward the rock. When the 'wall' of bomb clips hit the rock, the bomb clip that touches the rock goes to frame two, which is an explosion. What I am trying to do is have the bomb clips progressively explode in a chain reaction away from the one bomb that actually touched the rock in a way that i could control the speed of the reaction. Thanks for any help!

Reliability In Reaction Time Test
I am asked to build a reaction time test for the web. Trigging a soundsignal and have the user klick the mousebutton or pressing a key as respons. I wonder about the reliability in a swf like that published on the web. Would it be reliable in 10th of milliseconds or would it rather be in seconds taking in regard slow internet connections, overloaded cpus, different kinds of operating systems and browsers and so on. I use Flash 8.

Greatful for some expert knowledge

Collision Reaction/Bounce Angle
I have a ball that collides with a dynamic line. The line is created by drawing from one point to (lineTo) a second point and updates on almost every frame. I have the collision part working and the ball is able to detect when it hits the line.

I can't figure out how to get the ball to react correctly though. I can't get it to bounce off at the correct angle of the line. I've looked through lots of tutorials and code and can't seem to get any to work right. Also some code seems to only work if a ball collides on one side of a line. I need the reaction to work if the ball collides on either side of the line.

I know I have to calculate the angle of the line. And I'm doing that by getting the difference between the 2 points that create the line. (var angle = Math.atan(paddles1.differenceY / paddles1.differenceX)) I can't get any other code to work and relate it to x/y ball position and vx/vy veolicty.

Any help would be great.

Bit Of A Slow Reaction To MC Click And Drag
Hey folks,
So, I have a program with 14 buttons. I have made them movie clips with a few frames, and click will send them to frame 3 or 1 depending... They are created and live on the stage in Flash, but take their code from a Class called ProductButton, which gives them the listeners for click and release. When one of the MCs is clicked on, it moves to frame 3 (making it green), moves itself to the top of the other 13 buttons, and gets a startDrag(). My issue is that often, when moving the mouse fast and clicking, the clip won't start moving until after the mouse has left it. This will cause the clip to move, but there is an offset from the mouse position, and it won't get the release handler properly, since the mouse isn't actually over it. A release of the mouse button has no effect, and the clip continues to follow the clip around the stage with an offset. That part isn't a huge deal, because I can add a listener to the stage to deal with it. BUT, it matters a lot that the clip is not following the mouse, and depending on the offset, the MC could be impossible to drop on certain areas of the screen.

I have removed everything else that happens on the click except for the startDrag(), and I still get the odd behavior. At times, it's as if the clip starts to follow the mouse and be dragged, but snaps back to it's original position and then starts to move again, creating the offset. I have attached the Class code I am using. There are some extra imports in there, because I haven't gotten to everything I need to do. I have tried to strip everything out to see if I can nail down what the issue is. Again, this class is assigned to a movie clip with a few frames, the 3rd being the down state. It's a bit odd, but maybe there is an over-arching thing I am not getting or something. Thanks...

- B







Attach Code

package {
import caurina.transitions.Tweener;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.TextFormat;
import flash.utils.*;
//
public class ProductButton extends MovieClip {
//
var origX:Number;
var origY:Number;
var checkStatusInterval;
//
public function ProductButton() {
//
for (var i in this) {
trace(this[i]);
}
//Take note of the current position
origX = x;
origY = y;
//Add the listeners for clicks, etc.
addEventListener(MouseEvent.MOUSE_DOWN, mouseClick);
addEventListener(MouseEvent.MOUSE_UP, mouseRelease);
//Add this to the array that tracks the 14 buttons
(parent as MovieClip).buttonList.push(this);
}
//
public function mouseClick(e:Event):void {
if (alpha == 1) {
startDrag();
gotoAndStop(3);
moveToTop();
}
}
//
public function mouseRelease(e:Event):void {
if (alpha == 1) {
checkHit();
resetAllColors();
stopDrag();
gotoAndStop(1);
Tweener.addTween(this,{x:origX, y:origY,time:1});
}
}
//

//
private function checkHit() {
var myHit = null
if (this.hitTestObject((parent as MovieClip).mcCellPhone.mcIntersect)) {
myHit = "cellPhone"
} else if (this.hitTestObject((parent as MovieClip).mcDebit.mcIntersect)) {
myHit = "debit"
} else if (this.hitTestObject((parent as MovieClip).mcCredit.mcIntersect)) {
myHit = "credit"
} else if (this.hitTestObject((parent as MovieClip).mcCheck.mcIntersect)) {
myHit = "check"
}
trace(myHit+name);
}
//
public function resetAllColors() {
var myList = (parent as MovieClip).buttonList;
for (var i in myList) {
myList[i].resetColor();
}
}
//
public function resetColor() {
gotoAndStop(1);
}
//
public function moveToTop() {
var topPosition2:uint = parent.numChildren - 1;
parent.setChildIndex(this, topPosition2);
}
}
//

}

























Edited: 03/04/2008 at 10:32:26 AM by BSpero

Loading GIFs Into MovieClips... No Reaction?
Greetings, all-

I'm using the following code to load two gif images into two movieclips (I used the sample code from the flash help and adjusted it a bit):


Quote:




//---------------------------------------'
var team1_img_file = "hamburg.gif";
var team2_img_file = "gladbach.gif";
//---------------------------------------'
_layer2.createEmptyMovieClip("team1logo",0);
with("team1logo") {
createEmptyMovieClip("container1",0);
container1.loadMovie(team1_img_file);
};
//---------------------------------------'
_layer2.createEmptyMovieClip("team2logo",0);
with("team2logo") {
createEmptyMovieClip("container2",0);
container2.loadMovie(team2_img_file);
};
//---------------------------------------'




The gif images are in the same folder as the flash file- does flash require a physical path / full address?

The facts:
- I receive no error.
- "_layer2" does exist and is not obscured by anything.
- using "this" instead of "_layer2" gets the same result.
- the images don't show up.

I am satisfied with every fact except the last. any ideas?

Thanks!

Collision Reaction/Bounce Angle
I have a ball that collides with a dynamic line. The line is created by drawing from one point to (lineTo) a second point and updates on almost every frame. The angle of this line is constantly changing. I have the collision part working and the ball is able to detect when it hits the line.

I also have the collision reaction somewhat working. The ball will only bounce off the line correctly if y2 < vy1. So I'm not sure what the reaction code should be to work when y2 > vy1.

Here's code I'm using:


Code:


private function angleBounce(lineNumber, lineAngle){


// get angle, sine, and cosine
var angle = lineAngle;
var cos:Number = Math.cos(angle);
var sin:Number = Math.sin(angle);

// get position of ball, relative to line
var x1:Number = ball.x - lineNumber.x;
var y1:Number = ball.y - lineNumber.y;

// rotate coordinates
var y2:Number = cos * y1 - sin * x1;
// rotate velocity
var vy1:Number = cos * ball.vY - sin * ball.vX;

if(y2 > -ball.height / 2 && y2 < vy1)

{
// rotate coordinates
var x2:Number = cos * x1 + sin * y1;
// rotate velocity
var vx1:Number = cos * ball.vX + sin * ball.vY;
//var vy1:Number = cos * ball.vY - sin * ball.vX;

y2 = -ball.height / 2;

vy1 *= -1;
// rotate everything back;
x1 = cos * x2 - sin * y2;
y1 = cos * y2 + sin * x2;
ball.vX = cos * vx1 - sin * vy1;
ball.vY = cos * vy1 + sin * vx1;

ball.x = paddles1.line1.x + x1;
ball.y = paddles1.line1.y + y1;
}

if(y2 > -ball.height / 2 && y2 > vy1)

{

What code to put in here??????

}
}
Here is what I'm trying to do. This is what I have so far: http://naturalui.com/labs/wong.swf

Click the green button (if the lines stop drawing, click the button again). For the most part it looks like things work, but occasionally the ball will go through the lines when it should always bounce off.

Is there a better/easy collision reaction code that will work on both sides of a line?

Any help would be great.

On Release Stop On Release Play. How?
Its like a stop and play button. Like, lets say a button or much more likely, a movieclip, in the shape of a pause button, is clicked, it stops on the frame. Once it is clicked, it looks like a play button, and when it is clicked again, it plays from that same frame, And it then looks like a pause buttons again. How?

Scrollbar Reaction On Leaving Flash-stage
Hi all,

I've created a scrollbar to scroll mc's...its working
BUT :
if i drag the slider up and down and in the meantime leaving the flash-stage with my cursor(mouse) then the slider stopped.

So the scrollbar is only reacting if i'm in the flash object area

Can i change this behaviour ?!?

Thnx,
Ludo

Any Efficient Approaches For Collision Detection And Reaction?
Hi,

I have just a completed a piece of work wherein a user can build matchstick structures. The near finished piece is here:

MatchStick Structure prototype

The problem I'm having is slight but important to the piece - the code on each match performs a number of loops to check what it is hitting and if it should fall down. Because there are around 50 matches and more and the code has four or five nested loop each time when the code updates the screen freezes for about 2 seconds.

This delay has really been affecting usibility in our testing. So, questions are:

1. Can anyone suggest an approach better than the way i have done it; i.e is there a proven programming approach for collision detection and reaction that can deal with an ever increasing (say up to 200) number of objects on screen at once? (Referals to examples etc all welcome...)

(I'll mail you the source file to look at the code if you'd like a closer look...)

2. Is there a way to seperate the video bkg out somehow so that it won't pause, or is this just not possible?

I know this is not a very specific post but any help would be very very useful in finally finishing this piece (its been a long one...).

Thanks in advance for anything at all!

G*

Recording User Reaction Time In Flash
I am running several visual cognition experiments using Flash. See there here: http://vacognition.wjh.harvard.edu

Experiments are by definition interactive, in that I am recording data from the people who participate. Currently, I just record accuracy (did they answer a question correctly or not). Many experiments require getting reaction time -- that is, how long did it take them to respond. How accurate can I expect my measurements to be? In the lab, they would be accurate to about 2-5 milliseconds. I know it won't be that good with Flash over the Internet, but does anybody have any idea *how* accurate?

Oh, and please participate in the experiments that are currently running. I need many, many people to participate, especially for this experiment

Gotoandlearn Carousel / Limit Reaction Area
hello
i'm tweaking the well known carousel from gotoandlearn v3 flash 8/as2 as a navigation.loading external mc's onto stage.
i searched the forum but couldn't find a post on my problem:

is there a way to restrict the carousel movement e.g. when the cursor moves a certain distance away from the carousel ?
it's slightly disturbing when you load something onto stage and the carousel keeps moving

thx for reading

fla attached ( flash 8 )

Duplicated Movie Clips Divided Into Continuous Reaction
Hey, I need this for my game which is due out in like 5 days, so I need your help, Ok, so i want my background to repeat, over and over again, I have one movie named 'car'.

I cant really figure anything out, can someone help me, the car has to go straight up on the road.




onClipEvent (load) {

ground.duplicateMovieClip("ground2", 100);
ground2._y = ground._y+ground._width;
groundStartx = this._y;
groundSpeed=10;

}

onClipEvent (enterFrame) {

if (_root.spaceship.scrollStart){
this._y-=groundSpeed;
if (this._y<= (groundStartx-ground._width)){
this._y=groundStartx-groundSpeed;
}
}

}



~~~
What does it mean when it says ground duplicate movie GROUND2, I dont understand that, I got this off a tutorial on flashkit and i'm tring to bring it alive.. can someone please be kind enough to help me threw this, THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!

Circle-line Collision Dection And Reaction Problem. Please Help
i've encounter a serious problem. can someone take a look at my code, there is a error with ball and wall collision detaction and reaction after 1 to 2 mins. i was trying to solve the problem but it seems that my skills is not enough. please help me anyone? thank you very much! :P

Game Developing And Isometric Design And Reaction Please Respond
hey I is chuckmul again. I am starting a new game of war stratigy. It has an Isometric veiw point. I was just wondering how I could first make the I sometric grid using flash and second make a fully interactive enviroment thanks to any one who helps. and the real thing

Game Developing And Isometric Design And Reaction Please Respond
hey I is chuckmul again. I am starting a new game of war stratigy. It has an Isometric veiw point. I was just wondering how I could first make the I sometric grid using flash and second make a fully interactive enviroment thanks to any one who helps. and the real thing

MC "chain Reaction"
I'm up to my ears trying to learn ActionScript. Here's what I suspect is a fairly simple task but can't quite get it:

I want to move a MC across the stage with actionscript and when it gets to a certain point, it signals another MC to do the same thing. Sort of a chain-reaction thing. I can it to work all right except I can't get the second clip to stop when I want it to (because the first keeps feeding an argument for "speed" into it.) Ideally, I'd like to be able to have multiple clips that all trip one after another as they come to a stop.

Thanks in advance for any insight !

Here's the code:

//this is attached to the first movieclip and fires the second one on the last statement

onClipEvent (load) {
this._x = 0;
endPosx = 550-(_width/2);
speed = 80;
endEase = 550-80;
}

onClipEvent (enterFrame) {
this._x=this._x+speed

if ( this._x>=endEase ){
speed=(endPosx-this._x)/1.5;
_parent.square_MC_2.speed=25;
}


}



//this is the second movieclip, the speed of which is set by the first

onClipEvent (load) {
this._x = 0+(_width/2);
endPosx = 550-(_width/2);
speed = 0;
endEase = 550-80;
}

onClipEvent (enterFrame) {
this._x=this._x+speed

if ( this._x>=endEase ){
speed=(endPosx-this._x)/1.5;
}


}

On Release
may sound a little stupid but, can't get the onrelease command to be available to me on flash 5. it keeps saying:
"Clipboard Actions: Line 1: Mouse events are permitted only for button instances
on (release) {"
HELPPP!!!

On Release (if .. Else )
I'm trying to on release of a button check the _y position of a MC on the stage. I wish to reposition it from position 1 to 2 if it's at 1 else I wish to reposition it to position 1 if it's at position 2.

Hope that made some sense, I'm not sure if I have to put this into a function then called it on the button release? If so where do I put the function?

This is the code so far :
on (release)
{if (move == 300) ){
setProperty ("move", _y, "300");
}else {
setProperty ("move", _y, "100");
}

Copyright © 2005-08 www.BigResource.com, All rights reserved