Delete AS With AS...
Is it possible to delete Actionscript on a movieclip by hitting a button?
What I want to move something around in my animation while it is playing with the arrow keys, which is easy enough. But then, when I hit enter (or some other button) I want it to remain stationary until it gets deleted later on (since I'm probably going to put in another movieclip that is moved with the arrow keys, remains stationary, and then gets destroyed). So I was thinking that I would delete the actionscript inside of the movieclip once I get it to where I want it to be.
Is it possible to delete lines of code using lines of code, or is there an easier way to solve the above problem that I'm not thinking of?
P. S. Using Flash 8
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-24-2007, 07:17 PM
View Complete Forum Thread with Replies
Sponsored Links:
Delete Var
Hi all,
I made a simple mailscript in ASP and I managed it to work with Flash. It simply gets all vars from Flash and mails it to the specified address.
The problem is that I don't want ALL the vars to be send. A status check var for example shouldn't be mailed.
Is there any way I could delete (or deconstruct) a variabele in Flash?
Greets Rik.
View Replies !
View Related
Delete This.?
Good Morning, Afternoon, Evening FlashKit. Ive got a menu/menu slider (with jazzy fx) that works like a charm on my maintimeline (frame 1). Problem: when it jumps to frame 2, Im still left with my menu slider sitting, smiling at me . Ive been researching types/ways to eliminate this and do not have the creative fortitude this morning to be able to apply such methods effectively any help would be greatly appreciated. ThankYou.
Geoff
Code:
menuButton = new Array();
menuButton[1] = "standard";
menuButton[2] = "negative";
menuButton[3] = "singlesample";
for (i=1; i<=4; i++) {
_root[menuButton[i]].onRollOver = function() {
if (!_root.slider) {
_root.attachMovie("sliderID", "slider", 1);
_root.slider._y = _root[menuButton[i]]._y+145;
}
_root.attachMovie("fxID","fx"+i,2);
_root["fx"+i]._y = this._y;
_root["fx"+i]._x = this._x;
_root.slider.xtarget = this._x;
slider.onEnterFrame = function() {
this._x += (this.xtarget-this._x)/4;
if (Math.round(Math.abs(this.xtarget-this._x))<.5) {
delete this.onEnterFrame;
}
if (_root.slider.xtarget) {
_root.attachMovie("flashesID", "flashes", 3);
_root.flashes._x = _root.slider._x;
_root.flashes._y = _root.slider._y;
}
}
}
_root[menuButton[i]].onRollOut = function(){
_root.removeMovieClip(_root["fx"+i]);
removeMovieClip(flashes);
}
_root[menuButton[i]].onPress = function() {
gotoAndPlay(2);
}
}
View Replies !
View Related
Delete
I have a dude and a star.
When the dude walks against the star the score rises with 100.
But the star also has to be deleted.
Code:
onClipEvent (enterFrame) {
if (this.hitTest(_parent.dude)){
_root.score += 100
}
}
Please adjust this script so the star will be deleted if the dude walks against it.
View Replies !
View Related
Delete BTN
I have a movieClip that has two actions on it 1. a drag and drop 2. and enlargement when released
My issue is I have a BTN that will delete the movie clip, but I need an action that will make the BTN visible on release of the movieClip and delete it's self(the BTN) when it deletes the MC.
any help thanks
http://www.gardengatestore.com/flashTest.html
View Replies !
View Related
Will You Delete Please?
hi, Today, I would like to know how to delete a variable.
i have a abc.as
Code:
class abc
{
function delme()
{
trace("prepare to delete...");
this=null;
delete this;
}
}
im my scene:
Code:
var del:abc=new abc();
abc.delme//output prepare to delete ...
abc.delme//output prepare to delete ... <<I do not want this...
...but HOW? thanks!
View Replies !
View Related
Web --> XML Delete ?
im building a web and im targeting different frames to show contents... son frame 15 im building a Signature Book by AS3 ... the problem become when i return to previous frames, the xml document are still IN.
Its supposed to be a delete method on change frame?
my code more or less is like :
Code:
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, loadXML);
loader.load(new URLRequest("text/book.xml"));
function loadXML(e:Event):void
{
var xml = new XML(e.target.data);
Firmas(xml);
}
function Firmas(firmaInput:XML):void {
var textio:TextField = new TextField();
var textf:TextFormat = new TextFormat();
var fuente:Font = new Font1();
textf.font = fuente.fontName;
textf.size = 13;
textio.defaultTextFormat = textf;
textio.embedFonts = true;
textio.width = 400;
textio.height = 400;
textio.y = 50;
textio.text = "DEJA TU FIRMA";
var textio2pos:Number = 0;
for each (var item in firmaInput.firma){
var textio2:TextField = new TextField();
textio2.defaultTextFormat = textf;
textio2.embedFonts = true;
textio2.text = item;
textio2.height = 400;
textio2.width = 400;
textio2pos += 100;
textio2.y = textio2pos;
this.addChild(textio2);
}
this.addChild(textio);
}
? maybe can i make some IF statement on changing frame to delete all variables ?
View Replies !
View Related
How Do I Get Rid Of A Delete...
Code:
_root.nowPressed = " ";
buttons = [SX1, nokia6600];
if (_root.nowPressed == " ") {
for (j=0; j<buttons.length; j++) {
buttons[j].onRollOut = function() {
SX1._alpha = 100;
nokia6600._alpha = 100;
nokia3650._alpha = 100;
};
}
}
SX1.onRollOver = function() {
nokia6600._alpha = 50;
nokia3650._alpha = 50;
};
Nokia6600.onRollOver = function() {
SX1._alpha = 50;
nokia3650._alpha = 50;
};
SX1.onPress = function() {
delete this.onRollOut;
delete this.onPress;
_root.nowPressed = "SX1";
attachMovie("c01", "c01", "this");
c01._x = 412;
c01._y = 158;
//nokia6600._visible = 0;
//nokia3650._visible = 0;
};
Nokia6600.onPress = function() {
delete this.onRollOut;
delete this.onPress;
_root.nowPressed = "Nokia6600";
attachMovie("c02", "c01", "this");
c01._x = 412;
c01._y = 158;
endX = 372;
//SX1._visible = 0;
//nokia3650._visible = 0;
};
The button stops working but how do I get it to rework again?
View Replies !
View Related
Using The Delete Key
I seem to be having a problem using the delete key to trigger events. The code I'm using is to call a delete function and I've tried it with other keys and they work. I've written
listener = new Object();
listener.onKeyDown = function() {
if (Key.isDown(Key.DELETEKEY)) {
_root.deleteNote();
}
};
does anyone know why this doesn't work? Regards
View Replies !
View Related
XML Delete
I'm having trouble deleteing xml with the new "delete" command. I store a
reference to an xml element in a property or variable, it could be in a list
or data provider, or just in a variable.
delete myXml.chapters.item[2] // this works
myItem2 = myXml.chapters.item[2] ; // now i have a reference to item[2]
delete myItem2; // this won't work. Thinks I'm trying to delete the
variable or property "myItem2".
How can I delete an xml element that's a reference stored in a
variable/property?
View Replies !
View Related
Delete [fmx]
I have a question about a delete command inside a mouse event, imagine: I have an mc on stage and attach to this mc, some code(flash 5 style)
onClipEvent(enterFrame){
if(something){
something
delete this.onEnterFRame
}
}
but this dosenīt work, but in thae case I put this code in a frame in the timeline (flash mx style)
the code works
Why this works
thanks in advance
View Replies !
View Related
Delete MC
Hey all,
I have an external .swf load into the mc "container" when the page loads. When the user clicks on a button, I want to delete the mc. How would I go about doing this?
Thanks,
Dan
View Replies !
View Related
Delete
I just wanted to know if Flash's garbage collector is worth relying on? I could simply call delete when needed, if it will help consistancy and speed. Opinions?
View Replies !
View Related
Delete Help
Okay, so I'm trying to make a little game that has a whole bunch of objects moving towards a specific point, and you have to protect that point by defeating all the objects. In order to defeat the objects, you must continuously click on them. With each click, their alpha goes down by a certain amount, in this case, 10%, or 0.1. When their alpha is equal to 0, they die, and are deleted from the game. If you bring the cursor away from the object before its alpha is 0, then their alpha goes back to 100% and you must start all over again.
This is the code I am using for the instance "circle":
Code:
//--- Import ---\
import flash.events.MouseEvent;
///--- Lower Alpha And Delete ---\
addEventListener(MouseEvent.CLICK, mouseClick);
function mouseClick(event:MouseEvent):void{
circle.alpha-=0.1;
}
if(circle.alpha<=0){
var itemToRemove:DisplayObject = circle;
this.removeChild(itemToRemove);
}
///--- Return Alpha To 1 If Roll Out ---\
addEventListener(MouseEvent.ROLL_OUT, circleHeal);
function circleHeal(event:MouseEvent):void{
circle.alpha=1;
}
My problem is that when the object's alpha is 0 and is deleted, and you bring the cursor away from the object, its alpha goes back to 1, even though it is deleted. There are no compiler errors, so I'm not quite sure what's wrong. I appreciate any help. Thanks in advance =D
View Replies !
View Related
Delete [fmx]
I have a question about a delete command inside a mouse event, imagine: I have an mc on stage and attach to this mc, some code(flash 5 style)
onClipEvent(enterFrame){
if(something){
something
delete this.onEnterFRame
}
}
but this dosenīt work, but in thae case I put this code in a frame in the timeline (flash mx style)
the code works
Why this works
thanks in advance
View Replies !
View Related
Delete MC
Hey all,
I have an external .swf load into the mc "container" when the page loads. When the user clicks on a button, I want to delete the mc. How would I go about doing this?
Thanks,
Dan
View Replies !
View Related
AS3 - Delete Help
Okay, so I'm trying to make a little game that has a whole bunch of objects moving towards a specific point, and you have to protect that point by defeating all the objects. In order to defeat the objects, you must continuously click on them. With each click, their alpha goes down by a certain amount, in this case, 10%, or 0.1. When their alpha is equal to 0, they die, and are deleted from the game. If you bring the cursor away from the object before its alpha is 0, then their alpha goes back to 100% and you must start all over again.
This is the code I am using for the instance "circle":
Code:
//--- Import ---\
import flash.events.MouseEvent;
///--- Lower Alpha And Delete ---\
addEventListener(MouseEvent.CLICK, mouseClick);
function mouseClick(event:MouseEvent):void{
circle.alpha-=0.1;
}
if(circle.alpha<=0){
var itemToRemove:DisplayObject = circle;
this.removeChild(itemToRemove);
}
///--- Return Alpha To 1 If Roll Out ---\
addEventListener(MouseEvent.ROLL_OUT, circleHeal);
function circleHeal(event:MouseEvent):void{
circle.alpha=1;
}
My problem is that when the object's alpha is 0 and is deleted, and you bring the cursor away from the object, its alpha goes back to 1, even though it is deleted. There are no compiler errors, so I'm not quite sure what's wrong. I appreciate any help. Thanks in advance =D
View Replies !
View Related
Delete Key
is there any way to get around the delete key function that makes the browser go back a page? this is causing serious problems for me. uhg...
View Replies !
View Related
How To Delete A File
respected sir
i want to know that
how to delete a swf in flash
like i make a file abc.fla
n i make a button in it
then i want that if i open abc.swf
n if i press that button then flash
delete abc.swf
plz sir give me responce
n inform me that how
i can use this script or
how to delete a swf file in flash
thanx
View Replies !
View Related
Delete Scenes
Help
I started to build a Flashmovie and I made ten scenes. But now I realised I only will need three scenes.
When I choose Windows- Panels -scenes
it is impossible to delete the seven scenes I dont need.
How can I delete the scenes?
View Replies !
View Related
Delete Frames In Mx?
I'm a little late in the game on this one, but what happened to using 'delete' or 'backspace' to eliminate frames on the timeline? Apparantly, this no longer exists. Is there a simple alternative, or do I have to resort back to the mouse? Sorry about having to post this question. Thanks,
-xample
View Replies !
View Related
Delete Variable Or Value
Hi!
I have the following problem: I am using getTimer(); to do a pause in my movie. I have place a varibale tiempo=getTimer(); in the frame 15 in my main timeline and in the frame 16 I do a condition. It works perfectly but when the movie go to the last frame and starts again, when it beguin to the condition, it doesnīt work. I have tryed to use delete tiempo; I have tryed tiempo=false and tiempo=null aswell but I can not solve it.
Please help!!!
Les.-
View Replies !
View Related
Delete OnEnterFrame
I have a function with an onEnterframe in a seperate swf which loads into a mc called "video"in my main swf.
when it loads I wanted to delete the onEnterFrame so I have said
Code:
//ball = attachMovie("ball", "b"+i, i);
ball.onEnterFrame = spring;
function spring() {
//spring code here
if (_root._currentframe>1) {
this.myText.text = "";
delete this.onEnterFrame;
}
}
Now this works when the swf is played without been loaded into the video mc but if I loaded it into the "video" mc in the main swf it won't delete ball.onEnterFrame and it won't set the myText.text to blank.
I know this is just a scope problem can some please help.
View Replies !
View Related
Delete Button
Is there a way to delete a button which is inside movie clip? I am trying to do this and it is not working:
1.bt_button - instance name of the button(everything is inside movieclip)
this.bt_button.removeMovieClip();
thanks
View Replies !
View Related
Delete Function
is there a way to delete a function();
is have a function:
this.onEnterFrame = function(){
this._x += (pos - this._x)/2;
this._y += (posy - this._y)/2;
}
is there a way to delete or disable this function after i leave that frame? If seems to me that the function is still running even after i am on a different frame. Thanks
View Replies !
View Related
F5 Delete From Array
Hello
How do I remove certain character from a var loaded from a text file then build an array?
let's say the text file looks like:
var= 1: 2: 3: 4:
How could I remove the ': ' (colon and space), then put the remaining numbers into an array?
I was doing it in MX before using .split but now I need to do it in Flash 5, any ideas much appreciated.
Thanks
L
View Replies !
View Related
|