My button won't leave the stage.
I'm programming in AS2.0 using Flash MX2004
I attach the button "again" to the stage and its release function is gameOn where I remove the movie clip.
For some reason, It won't leave the stage...
I've tried to look at everything but maybe I'm missing something.
any help would be greatly appreciated. - function gameOn()
-
{
-
again.removeMovieClip();
-
}
-
-
function gameOver()
-
{
-
attachMovie("again", "again", 201);
-
again._xscale = 120;
-
again._yscale = 60;
-
again._x = 280;
-
again._y = 300;
-
again.onRelease = gameOn;
-
}
7 1810
Hi karlectomy!
That is no wroking because that's not the correct sintax to the removeMovieClip method.
The correct sintax is the following: -
someMC.removeMovieClip(targetMC);
-
What this does is removing the targetMC that's inside someMC.
If your movieclip "again" is on the root I reccomend to to declare a global variable (that is, outside any function) calld home for example, and making it equal to this (I mean, the "this" pseudo-object), so the variable home, will always be the local root, even inside functions.
Then you can use this as follows: -
var home:MovieClip = this;
-
-
function gameOn():Void {
-
home.removeMovieClip(again);
-
}
-
Best regards,
The_Nephilim
My button won't leave the stage.
I'm programming in AS2.0 using Flash MX2004
I attach the button "again" to the stage and its release function is gameOn where I remove the movie clip.
For some reason, It won't leave the stage...
I've tried to look at e
verything but maybe I'm missing something.
any help would be greatly appreciated. - function gameOn()
-
{
-
again.removeMovieClip();
-
}
-
-
function gameOver()
-
{
-
attachMovie("again", "again", 201);
-
again._xscale = 120;
-
again._yscale = 60;
-
again._x = 280;
-
again._y = 300;
-
again.onRelease = gameOn;
-
}
Thank you very much,
I see what you're saying.
can I attach and remove movie clips from the stage?
You're welcome!
What do you mean? Dynamically attaching a movieclip to the stage?
Thank you very much,
I see what you're saying.
can I attach and remove movie clips from the stage?
More specifically is this correct? -
-
stage.attachMovie("again","again",201);
-
-
again.onRelease = stage.removeMovieClip(again);
-
-
The sintax is correct, but you can't use Stage to do that, the Stage object only contains information about the movie, it is not a reference to the _root.
If you want to attach it to the root you can do as follows: -
var home:MovieClip = this;
-
-
home.attachMovie("again","again",201);
-
-
again.onRelease = stage.removeMovieClip(again);
-
-
Best regards,
The_Nephilim
More specifically is this correct? -
-
stage.attachMovie("again","again",201);
-
-
again.onRelease = stage.removeMovieClip(again);
-
-
Neph,
Thanks for your help. finally it's gone!! YAYAYAYA
The sintax is correct, but you can't use Stage to do that, the Stage object only contains information about the movie, it is not a reference to the _root.
If you want to attach it to the root you can do as follows: -
var home:MovieClip = this;
-
-
home.attachMovie("again","again",201);
-
-
again.onRelease = stage.removeMovieClip(again);
-
-
Best regards,
The_Nephilim
LOL!
Glad it worked!! You're welcome!
Best regards!
The_Nephilim
Neph,
Thanks for your help. finally it's gone!! YAYAYAYA
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Keith Rowe |
last post by:
Hello,
I am trying to reference a Shockwave Flash Object on a vb code behind page
in an ASP.NET project and I receive the following error:
Guid should contain 32 digits with 4 dashes...
|
by: trint |
last post by:
Ok,
I have created a flash animated button that I want to use as a regular
button in my c# web app.
Using actionscript, do you know how to call the c# functions in the
project?
Thanks for any...
|
by: -Lost |
last post by:
See, in ActionScript (Flash) I was able to do it this way:
frame 1 {
this.onEnterFrame = function () {
if (buttonIsDown) {
i += 1;
duplicateMovieClip(_root.layer.target, 'variable_name' + i,...
|
by: mutlyp |
last post by:
I have an web application, for a menu to go to page to page wit in the web app I am using flash buttons. The problem is that the first time I click on the flash button everything works fine the page...
|
by: elamberdor |
last post by:
Hi All!
Trying to get a drop down hide/show div on a html page triggered by a button in flash.
(Intro: Very very Little experience in dynamic flash)
setup: html page, flash map on page, button...
|
by: anuparvathy |
last post by:
i am using a flash template for my website.i am working on asp.net 2.0 for creating my website. this flash template has got buttons.on the click of the button i want the user to be redirected to the...
|
by: mel |
last post by:
Hi all,
I need a persistent TCP connection with my web server over page
reloads.
This means that, even if the user goes to a different page (in
my domain), I want to keep a TCP connection...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |