ActionScript 3.0 :: Write A Hitscan Function?
Feb 7, 2010Does anyone know how to write a hitscan function or how they work?
View 1 RepliesDoes anyone know how to write a hitscan function or how they work?
View 1 RepliesTake a look at this scenario, I have two characters, one shoots two bullets on the direction of the other character, the bullets are fired instantly and travel at infinity speed, how to detect a collision? Here's an image to illustrate the problem: The red bullet would clearly miss, but the green bullet would hit, how to perform this kind of collision test?
View 1 Repliesis it possible to write a function to move an object and then call that function on a clip event for instance
function (bounce){
script;
script;
}
and then call it by saying
on(mouseOver){
this.bounce;
}
I want to make these 7 events into one function that I can put on a few different buttons' onPress function so that I don't need to have those seven lines of code on every button, just one line instead:
Code:
tour_mc.unloadMovie();
logo_mc.tour_subnav.north_nav.enabled = true;
logo_mc.tour_subnav.south_nav.enabled = true;
[code]....
I prepared a swf movie which has 40 frames with 3 layers and 2 Scenes (Scene1 and Scene2) I add the following code to the first frame of the movie :
favekle.addEventListener(MouseEvent.MOUSE_DOWN, fave);
function fave(e:MouseEvent):void {
var url:String = "samplepage.aspx?sn=1011";
var request:URLRequest = new URLRequest(url);
navigateToURL(request, '_blank');
[Code]...
I've got 6 movieclips which I want rollover code to run off. I can write the code for the container1 movieclip pretty easily.[code]...
View 3 RepliesI have a problem with deleting the object .. whether anyone can tell me how to write a function that will delete the "car" when y> 500 | | y <0.[code]
View 1 Replieshow to write an elasticity function in MX?This works in 5 - but I want to use dynamic masking also - here's the code (slightly modified from Ilyas Usal. Ilyas is also known as ilyaslamasse )
MovieClip.prototype.move = function (centerx,centery,inertia,k) {
x = -this._x + centerx ;
y = -this._y + centery ;
xp = xp * inertia + x*k ;
yp = yp * inertia + y*k ;
[code].....
then you can set newx and newy how ever you want buttons or timeline.I need it to work in MX ?
how to write an elasticity function in MX?
This works in 5 - but I want to use dynamic masking also - here's the code (slightly modified from Ilyas Usal. Ilyas is also known as ilyaslamasse )
MovieClip.prototype.move = function (centerx,centery,inertia,k) {
x = -this._x + centerx ;
y = -this._y + centery ;
[Code]....
then you can set newx and newy how ever you want buttons or timeline.
How to write the GetURL function to a button in AS3?
View 6 Repliesi use Adobe flash player in my site, and now i need to increment some filed in database, when user click on player.here is the script
<div id="conteiner" style="text-align: center;" ></div>
<script type="text/javascript">
var s1 = new SWFObject("player.swf","ply","420","380","9","#FFFFFF");[code]...
i deside to use ajax for it, but how can i write a function in the flash object?
UPDATE: i only have the swfobject.js file, which contains such data
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new [code]....
and the player.swf, and the html, i've shown allready. i don't now is this flash player or no, and what can i do?
how would i write a function for rollOut from stage?ex:
ActionScript Code:
stage.onRollOut = function()
{
//code here
}
How to write a function for cube root?
View 2 Repliesi want to write a function which has 2 dimensional array as one of its arguments
_global.getList = function ( type:Number, list[]:Array )
this is giving syntax error,
if i do
_global.getList = function ( type:Number, list:Array )
then there is no error, but then, list is now, single dimentional array, which i dont want.
whats the correct syntax to write it as two dimentional array ??
I have byte array, and I want to write into it a Function object, like the following:
var func:Function = function f(event:Event):void
{
trace('hello');
}
[Code]....
I have an fla that uses the following AS:
PHP Code:
envisionblur._alpha = 100;
envisionblur.onRollOut = function(){[code]...........
I have four MC's that I want to fade onRollOver and onRollOut. As you can see, writing code for each MC is a rather convoluted way to achieve the effect.how to write the code as a function and apply it to all of the clips?
Basically I'm trying to write a function that can look at any movieClip no matter how far down it is nested and then tell a MC sitting in the root movie to lay over it.
View 1 RepliesI would like some help on writing a piece of code.I need to write a function that if some movie clips are in some x and y value, then gotoAndPlay('end');
Code:
function gotoEnd() {
if
(tv_mc._x = 41.8;
tv_mc._y = 157.3;)
then
gotoAndPlay('end');
}
How can I have a function create Array depending upon the passed argument. Am I doing this right?
function createArray(n:int):Array
{
for(var i:int=0; i<n; i++)
{
var nArr = new Array();
[Code]...
I'm starting to learn Objective C and I wonder if there is any similar function toactionscript trace to show messages in a console.
View 1 Repliesi want to write a function that is used by multiple buttons and accepts a variable when it is called by a given listener..
ActionScript Code: this.fileBTN.addEventListener(MouseEvent.MOUSE_OVER, menuSet("fileMenu"));
function menuSet(what:String){
trace(what);//should trace back "fileMenu"
}
Im trying to write a function that will build a menu based upon the vars that I passed it to. This is a simpler version on the code.(The library has a MC/Btn symbol with the linkage "btn");
Code:
function bulidMenu(nItems:Number) {
var menuMCx:Number = 100;
var menuMCy:Number = 100;
[code]...
Why do I get an output of 4 on every clicked button, instead of 0,1,2,3 ? I tryed forwarding the " i " to the onRelease = function(i) {} and then in it declaring a new var and assigning it the passed " i ", but that doesn't work either :/
I have recently moved from AS2 to AS3 and trying to learn my way around as3.I need to know how I can make a function for the users to be able to type/write in Flash application...Basically what I need at this stage is an input text field and a dynamic text field and when the users type anything in the input text, the dynamic text will be updated and it will show the texts.
View 3 RepliesOnly the number and alphabet is allowed to be contained in the input string, return true or false.
function is_valid(str:String):Boolean {}
My implementation is dumb, as I want to iterate each character.
Input: akjd8899kdjfj2kj return: true.Input: kjd^kdjf^%%$ return: false
Im trying to write a global fucntion for button rollOver, rollOut animation.
here's what I have as of right now.
On the root timeline::
stop();
function buttonFade(fade) {
if (fade) {
[Code]....
Im still wishy washy on function syntax..
I'm trying to read a XML file and output the values, but i'm getting a 1120: Access of undefined property URLRequest. error.
[Code]...
I've got a Vector of ViewToActionMap objects, which have following constructor:
public function ViewToActionMap(_forModule:eModule,
_forAction:eViewAction,
_toFunction:Function,
[code].....
I have received this big client wants a gallery built for this website. Problem I do not know how to write in flash. How to make a write flash file? Please help me this big client to work.
View 1 RepliesSo I'm kind of an Actionscript/XML newbie, but I'll try to be as useful as I can:
I'm writing some code where I want an input text box to create a new node in my XML with that text as an xml tag.
I have a simple Flash/XML slideshow-esque presentation that uses images+audio.I want to hand it over to a client but I think managing the XML is too advanced for them.I'm thinking I might need to hand over an HTML form with some PHP to allow them to upload assets and add/delete slides. If I could make it in Flash, that would be even better. I'm thinking that if I do it in Flash, I can set an interval to keep reloading the XML in so the client can see their edits as they create a presentation.
View 3 Replies