00:00
00:00
Newgrounds Background Image Theme

Chan99 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

unloadMovie state check

362 Views | 6 Replies
New Topic Respond to this Topic

unloadMovie state check 2014-08-21 02:25:59


i' am currently making a rpg game. the players goal is to collect and complete artifacts, read its description, and win the boss appears, the player needs to answer the questions given by the boss.

the problem is when i unload a movieclip and i check its _visible property, the result is true even though its is already unloaded. here's my code:
the code in the save button -> itemSwordVisible = _root.itemSword._visible;
the code in the unloaded mc -> _root.aryInv[i]="swordL";
this._visible = false;
unloadMovie(this);

the most important thing i want to know is how do i know if a mc is in a state of being unloaded or not


I don't have formal education about flash game development. all i know is the product of my self-study alone. so, kindly help me.

Response to unloadMovie state check 2014-08-21 04:12:20


http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001366.html

"Removes the contents of a movie clip instance. The instance properties and clip handlers remain."

Response to unloadMovie state check 2014-08-21 06:53:31


i already done the unloading part, but thanks anyway. can you tell me how can i know or can the program know that a mc is unloaded. because what i want in my game is when the character hits a mc, to be specific an artifact, the mc unloads. and when the player hits the save button the program saves the character, enemies, and artifact properties like their respective _x and _y and for the artifacts if the artifact is visible or not

charX: -489.1 charY: 113
enemyX: 278 enemyY: -218
enemy2X: 778.3 enemy2Y: -8.7
itemSwordVisible: true itemSwordX: -505.3 itemSwordY: -19.8
itemSword2Visible: true itemSword2X: 1991 itemSword2Y: -190.25
jarVisible: true jarX: 1630.3 jarY: -89.7

this what my trace gives me on first run, its also what appears when an artifact is already unloaded.
or is there a way i can "destroy" the mc then create it again if needed


I don't have formal education about flash game development. all i know is the product of my self-study alone. so, kindly help me.

Response to unloadMovie state check 2014-08-21 07:09:42


At 8/21/14 06:53 AM, halfblue3 wrote: can you tell me

No.
I have no desire to investigate problems with As2 any further.
Good luck.

Response to unloadMovie state check 2014-08-21 07:47:29


well thanks for helping. thank you for spending some of your time


I don't have formal education about flash game development. all i know is the product of my self-study alone. so, kindly help me.

Response to unloadMovie state check 2014-08-21 22:11:19


I do AS2
and whenever I want to check if a movie clip is still on the stage

it's
:if([MCname]._x == undefined)

there might still be some problems with instances and handlers as you unload the clip, good luck on your project

Response to unloadMovie state check 2014-08-22 00:53:09


thanks. hey, is unloading a mc also means automatically setting it's visible property to false? because a want to track if a mc is visible or not if the player hits a button, or do i need to set it to _visible = false?


I don't have formal education about flash game development. all i know is the product of my self-study alone. so, kindly help me.