ActionScript 3.0 :: Write Function That Will Delete 'car'
Aug 8, 2010I 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 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 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;
}
Is it possible to delete a function?
I have a reusable function, on the first frame it works, but on the 2nd it doesn't load properly and duplicates itself because the other function is still running in the background.
I want to name a function, and in the next frame of the movieclip to delete it.[code]...
View 7 RepliesThe order of events are this. From the main stage I load a movie clip (movie clip 1), within that movie clip I have a button that loads another movie clip (movie clip 2) and also starts a timer that will automatically unload movie clip 2 . Within movie clip 2 I would like to create a button that stops the timer on movie clip 1 and starts it again.
I need to stop a function in movie clip 1 from movie clip 2 and then start that same function on movie clip 1 from movie clip 2.
This is the code I am using
This is the movie clip 1 code:
PHP Code:
function moreTimerFun(moreTime) {
this.onEnterFrame = function() {
if ((getTimer()/1000)-moreTime>7) {
delete this.onEnterFrame;
[Code].....
I have a function that creates a snowfall effect in Flash as2.
What I want is to be able to delete the two functions that create this effect after 30 seconds or remove the attachMovie after 5 seconds.[code]...
I have:
ActionScript Code:
package
{
[code]....
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]....
when we write
var obj1=new Object();
var obj2=obj1;
we know obj2 is just a call of obj1, they are the same thing.also, prameters of function are also the calls of the object outside e.g.
var objC=new Object();objC.name = "Jhon";[code].........
it seems that when setting tar to null, the obj outside in the function didn't changeit seem taht everything you do will pass to the real object, but not setting it to null;
my questions: how to make the real object became null with a call?
I am working on a paintbrush application in AS2.Currently I am working with drawing a circle. I have a circle movieclip in library. Whenever users click and drag on the stage they can design a circle. I am using mouseDown, mouseMove and mouseUp event for this.So for mousedown I am calculating the current x and y position then for mouseMove the circle starts to grow depending upon the x and y position of mouse.Then for mouseUp I am deleting the mouseMove function, so that it stops drawing. This is working fine. But when I want to draw another object on the stage the mouseMove function does not work. I am confused on how to undelete the mouseMove function.[code]
View 2 Replies"you cannot delete variables that are declared within a function with the var statement".Which, as it happens, is precisely what I was trying to doI want to delete the object because it holds a bunch variables that are no longer needed, to prevent potential speed/memory issues later on.it's impossible (probably with reason) and I know vars are local to a function, so now I'm wondering if it is actually necessary to remove local variables
View 3 RepliesI 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 RepliesDoes anyone know how to write a hitscan function or how they work?
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.
Is there any advantage to deleting vars instantiated within public or private functions in a class, or are they removed from memory after the function has been invoked/run? The function below is completely arbitrary for example:
Code:
private function someFunctionHere(_ar:Array):Void {
var _swf:String = _ar[0];
var _nm:String = _ar[1];
[Code]....
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'm creating something like a text editor. I have text-movieclips at set coordinates. I'm trying to create a function to delete entries. My idea is that my cursor is at the text-mc's coordinate so I'd like to be able to connect the delete key to any clip that happens to match my cursor(x,y). Like this:
if ((Key.getCode() == Key.DELETEKEY)){
if((anytxtclip == cursor._x) && (anytxtclip == cursor._y)) {
delete anytxtclip
}}
I think I'm looking for a world variable to describe anytxtclip.
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"
}