Copy link to clipboard
Copied
Hello i am newbie with action script 2 and i am develop a escape game in flash cs5 with action script 2.The problem is that i have created some variables on layer named action script to make invisible a movieclip when its clicked.
action script layer code:
var mymovieclip=0;
if (mymovielip==1)
{
_root.mymovieclip._visible=false;
}
and movieclip code:
onPress()
{
_root.mymovieclip._visible=false;
}
if (mymoviclip==1)
{
_root.mymovieclip._visible=false;
}
after all that , when i click the movieclip its being invisible but!!! when i change another layer that movie clips appears again."I could not find permanently hide this movieclip when its clicked".Sorry for my english and my codes works as well (i mean i can be write them wrong here but they works well in flash) can you help me please?
Copy link to clipboard
Copied
this is the only code that's meaningful (unless you assign mymovieclip or mymovielip or mymoviclip to 1 someplace not shown),
onPress()
{
_root.mymovieclip._visible=false;
}
p.s. - and i assume some of those are typos -
p.s.s. if _root.mymovieclip disappears and then reappears there's either coding making it do so or it appears on another keyframe and is another instance
Copy link to clipboard
Copied
first of all thank you for your answer theres no variable movielip or movieclip with that..this is my fault i used this code in my previous flash games but i lost the codes.I remember how i blocked reapperance of movieclip when every change of frames.
Just open flash and create 5 different keyframe than put a movieclip there and make it invisible with the code.After that when you go to another keyframe (gotoandstop code) you will see this movieclip reappears! i cant find a way to block it appear 😕
Copy link to clipboard
Copied
yes its appears on another keyframe..i put gotoandstop code soo when i go to another keyframe this movieclip appears and appears..i think i have to tell it to flash with some variables for making invisible permanently.
Copy link to clipboard
Copied
remove all instances of mymovieclip
add mymovieclip to the first keyframe where you want it to appear
add the following to whatever object you want to be clickable
onPress()
{
_root.mymovieclip._visible=false;
}
add your other keyframes on the layer that contains mymovieclip where you want mymovieclip to change properties (eg, position).
Copy link to clipboard
Copied
thank you for help my friend i will try that today and if i cant i can upload the .fla file and thanks again.
Copy link to clipboard
Copied
you're welcome.
(p.s when using the adobe forums, please mark helpful/correct responses, if there are any.)
Copy link to clipboard
Copied
my friend i have uploaded the file for you can you check the .fla please i wrote instruction in it and you will see..:(
(its trusted no worry)
Copy link to clipboard
Copied
when i go back main stage that box is being visible again i tried everyway
Copy link to clipboard
Copied
i don’t dl and fix files unless hired. free help i only offer via the adobe forums.
Copy link to clipboard
Copied
i dont want you fix the file and i am trying to show you its a basic problem and my english is not to explain you this and only a developer can fix it..
I am saying:_root.samplemovieclip._visible=false; >> this code is not enough to hide a movieclip permanently we have do this with variable..
all i want is when i click samplemovieclip "it must be invisible forever" no more appereance or repeat or anything.
thanks for help
Copy link to clipboard
Copied
up
Copy link to clipboard
Copied
you're welcome.
Copy link to clipboard
Copied
up , the problem is not solved
Copy link to clipboard
Copied
Copy link to clipboard
Copied
did you follow these steps:
remove all instances of mymovieclip
add mymovieclip to the first keyframe where you want it to appear
add the following to whatever object you want to be clickable
onPress()
{
_root.mymovieclip._visible=false;
}
add your other keyframes on the layer that contains mymovieclip where you want mymovieclip to change properties (eg, position).
if so, put mymovieclip in its own labeled layer and attach a screenshot of your main timeline so i can that mymovieclip only exists in one keyframe.
Copy link to clipboard
Copied
yes i followed your instructions but when i removed instance name , nothing worked.
Copy link to clipboard
Copied
this is an escape game project my friend..i want that movieclip must be disappeared after clicked one time..
Copy link to clipboard
Copied
i will fail if player gets an item and if it appears again in his inventory..:)
Copy link to clipboard
Copied
up
Copy link to clipboard
Copied
you did nothing that i suggested and you did things that i did not suggest.
Copy link to clipboard
Copied
you said me remove instances of movieclip i did and i removed mymovieclip's instance name
i added mymovieclip on first keyframe as you requested
than i added my code in it:
onPress()
{
_root.mymovieclip._visible=false;
}
thats all i did.
Copy link to clipboard
Copied
i didn't say anything about removing any instance names
the code you showed was different
and you didn't place mymovieclip on its own layer.