ActionScript 3.0 :: Not Reload An Already Loaded Movieclip When Clicked On Navigationbutton?
Aug 21, 2009How to NOT make Flash reload an already loaded movieclip from the navigationbar/buttons when clicked on. [code]...
View 3 RepliesHow to NOT make Flash reload an already loaded movieclip from the navigationbar/buttons when clicked on. [code]...
View 3 RepliesI have parent movieclip and in that many different children movieclips
What i want to do is when i CLICK, i want to detect which movieclip it has clicked and call corresponding function (defined by onpress event) of that movieclip.
I'm having trouble with a button script my client has asked me to create. I need to put together a script to detect if a specific movie clip "port_fade.swf" has already been loaded and into a container and if so don't reload it. This clip has to load on a on(release) function. I have 8 buttons and depending on which button a visitor clicks on I need the clip to load. I don't want to have it reload every time a button is clicked.
I found this code but it doesn't seem to work.
function loadExternalSwf() {
if (containerFade.thisID == "port_fade.swf") {
trace("Content already loaded - Don't do anything.");
} else {
mcl.loadClip("port_fade.swf", containerFade);
[Code] .....
what would i have to do to prevent "submenu.swf" to reload when it's already loaded. this is the as i use:
on (rollOver) {
if(this.content == Number(this.content)){
loadMovieNum("submenu.swf",this.content);
} else {
this.content.loadMovie("submenu.swf");
}
}
I am interested in designing a web-site with the primary purpose of displaying various poems and songs I've written over the years. The premise is simple: I need some actionscript which will detect the number and names of text files in a certain directory, and randomly pick one of them, then load it into a text field and format it with CSS. The user should simply have to reload their browser to get another randomly loaded poem. I've only taken one Flash class (very light on AS) and not at all knowledgeable on making 'universal AS' and usually hard-code everything. My apologies if something similar has been asked before..
View 14 RepliesI've been reading a lot of threads lately because I'm working on a school project. But can't really find a solution to my current "problem"I'll try to explain this as clear as possible, as it is kinda complicated and English isn't my main language.I'm making a game for a school assignment, and I have 2 MovieClips. 1 = walkCycle and 2 = jumpCycle.I gave both of these MovieClips classes so I could use the addChild function.Everything works fine, the walk animation works, the jump animation works, but here comes my problem.I have an ENTER_FRAME check on the jumpCycle to discover whether it's finished playing or not because if it is (thats what the check is for) the jumpCycle needs to be removed again and the walkCycle added again.
And the problem is, the jumpCycle only works once...After this if I press the shift key again (the jump key), the walkCycle just disappears the amount of time the jumpCycle should play and then the walkCycle comes back again, but there's no jumpCycle animation.y guess is, because I checked if it's finished or not, it needs to be reloaded to be able to use it again or something?
At my site [URL] I have PHP/MySQL talking to flash, when the holder movie opens it loads my home.swf into the content movie clip... It works fine once but if you click the home button (which runs the same function) or refresh the page it blanks out the text field and won't reload the content.
Code:
stop();
goHome();
function goHome() {
_root.background_mc.gotoAndStop(1);
_root.holder_mc.loadMovie("home.swf");
[Code] .....
I am a super noob at actionscript. And I want my button to open a movieclip and then close the movieclip when clicked on again. I have no idea what to add after that here is the code I have for the button so far.....this button opens it.
on(release){
this.linemc5.gotoAndPlay("ear");
}
and this is another button I made that can close it, but I want it to be in the same button rather than seperate.
on(release){
this.linemc5.gotoAndPlay("earclose");
}
I've got music player and one of the controls is a movieclip which acts as a PLAY and PAUSE button. What I would like is to swap the image of this movieclip everytime it's clicked. How would I go about doing this?
Here's my code...
ActionScript Code:
playPause_btn.addEventListener(MouseEvent.CLICK, onPlayPause);
function onPlayPause(event:MouseEvent):void{
[Code].....
I've got music player and one of the controls is a movieclip which acts as a PLAY and PAUSE button. What I would like is to swap the image of this movieclip everytime it's clicked. How would I go about doing this? Here's my code...
[Code]...
Ive got my target game where the target spawns on the stage at a random position. When the target spawns however, i am unable to click it to shoot it?
Ive got my event listener for the target in my actions on that frame, but its giving me the following error:
1061: Call to a possibly undefined method addeventlistener through a reference with static type class.
If i comment out the addEventListener for the Target the game runs but i cant click it, if i dont comment it out i get that error and the game wont run.
At the start of my movie (its a game), you press a button that moves you to the second frame where the game starts when called by a function on the main timeline called startThisGame(). A symbol called "player" is spawned from a class called Player and when right or left arrow are pressed it responds by moving left and right. Problem: The "player" wont respond to key presses unless I first click anywhere on the actual game window, either in test mode or after publishing. This did not happen before and now it does.
View 3 RepliesHow can I check if a Movieclip is clicked.I have two MovieClips on my stage .one has the instance name "yes" the other one is called "no"
if yes is clicked it should do something
if no is clicked it should do something else
but how do I check which one was clicked ?
how to have a MC have _alpha = 0 when clicked anywhere outside the mc
View 9 RepliesIs there a way to capture what movieclip that have been clicked so I don't have to wright a new "nextFrame" function for every clip
myClip_mc.addEventListener(MouseEvent.MOUSE_OVER, overMyClip)
myClip_mc.addEventListener(MouseEvent.MOUSE_OUT, overMyClip)
function overMyClip(event:MouseEvent)[code].....
Ok, I've search through the forums but none of the posts seem to work for me. I've got 4 buttons that each have an onRollOver, onRollOut, and onRelease function on them. I would like the onRollOver state to stay in place after the user clicks the button they're over. Then, when the user clicks on a different button, that buttons down state sticks, and the previous button's state unsticks and goes to the rollout function. I've read through and tried this thread:[URL]
View 5 RepliesI'm trying to get a movieclip fill color to change once clicked. I'm able to get the mouseover and mouseout working. But the click state isn't working properly.
Here's my code:
Code:
my_mc.addEventListener(MouseEvent.MOUSE_OVER, onFolderOver, false, 0, true);
my_mc.addEventListener(MouseEvent.MOUSE_OUT, onFolderOut, false, 0, true);
my_mc.addEventListener(MouseEvent.CLICK, showMovieclip, false, 0, true);
[code]....
When I use the above code, nothing happens once clicked. I tried using the color property, but, although that made a color change (black), it wasn't the color I had indicated (white).What I have is a movieclip ("my_mc"). Inside the movieclip are other movieclips. When one is clicked, only that movieclip ("my_mc.movieclip01"), is highlighted.
I looped my buttons just fine. However, I am trying to load a movieclip based on what button is clicked. the code loads the same movie everytime though.
View 13 RepliesI have a simple arrangement where a movieclip moves to a new x y position when a button is clicked. I want the movieclip to slowly move or 'glide' there instead of jumping straight to the new position.
Heres the code..
btn_up.addEventListener(MouseEvent.CLICK, moveUp) ;
function moveUp(event:MouseEvent):void {{
allcontent.x += 200;
allcontent.y += 200;
}}
I'm so getting confused with this,So i'm making a card game, and i'm just on the beginning of it. I've already added the objects on the stage and stored them on an array.now i made a function that when it executes the .x and .y properties of these cards would change. this is what i did, but nothing seems to happen.the array MyCards contain movieclip objects not strings and also, the function executes when an instance in the movieclip is clicked
ActionScript Code:
distCards(MyCards);
function distCards(cards:Array):void {
for (var i:int=0;i<cards.length ;i++) {
[Code]...
How can I get the disappear (I used zoom out) Effect when I click another link I mean I want to get the zoom out effects for the previous movie clip when I click the next movie link.
View 5 RepliesWhat i want to happen seems quite simple yet i keep getting the error "access of undefined property" when what i'm trying to remove is in fact defined in the same class but it obviously cannot gain access to it.
I want to remove a MovieClip from the stage once a button has been clicked.The MovieClip is created in the same class as my button function i created. The button works fine but whatever i try to put within the function to remove the MovieClip cause the error i mentioned at the start.
I�m trying to send variables when a movieclip is clicked and use some frames later.
Code:
function langFr(e:MouseEvent):void{
var language = "fr";
play();
}
When the button is clicked, the movie plays until frame 10, where there�s the code:
Code:
if (language == "fr"){
trace ("French")
}
but it�s not working. I imagine that because I�m creating the variable inside the function and trying to read it outside. But how can it be done?
I have 3 movieclips on stage and what im trying to do is remove the movieclip when its clicked. the code i wrote is throwing this error.. "TypeError: Error #1006: value is not a function. at hitTestPointEx2_fla::MainTimeline/itsclicked()" Can someone please tell me what im doing wrong..This is what i have so far..
[Code]...
I'm coding buttons and have them all switching but I want to set b1 so that it doesn't replay a movieClip if it's clicked again. So I click on b1 and bring up page1, if I click on b1 again it replays the fade-in. How do I set this so if it's already loaded it won't load again?
[Code]...
I'm using some classes that apply to a series of movieclip buttons I found. I'm using the classes to get the buttons to rollover and when clicked stay in the down state, when another is clicked the previous button goes back to up state. The rollover works fine however it doesn't stay in down state when clicked.
Here is the code I have so far, I'm also open for substitute classes that will do the same thing.
ActionScript Code:
class ButtonClass extends MovieClip {
public var onPressDown:Function;
public function ButtonClass() {
this.gotoAndStop(1);
[Code] .....
I have a button in a movie that I want to set a global variable to a new value when clicked. I want it to access a parameter of a movie clip that this same button loads onto the movie for the new global variable value. I have the final line under this button's onrelease script with something like this:
globalvariable1 = movieclip.parameter;
Everything is on level 0 and I've tried prefixing everything with _root. but it didn't make a difference, the global variable still wasn't changed. I'm a newbie so don't laugh if this is a really dumb question!
BriCar77
brian_carey77@ou.edu
I'm loading an external swf that is a button to close other loaded movies. I want it to stay above all the other movies at all times so that the user has a way to close them and go back to the main stage. There are buttons on the stage that load external movies and the close button movie loads automatically. All of the movies load in fine but once I load in a movie from a dynamically created movieclip button on the stage, it covers up the close button movie.The following code is where I dynamically load movies from the dynamic movieclip buttons and then after that is where I load in the external swf for the close button.
//Dynamically assign external movies to load from
//the dynamic buttons
for (j=1; j<holderArray.length; j++) {
[code]...
The below MouseDown() event works on for a squire area. How can trigger a MouseDown() event when clicked on a custom shape movieclip?
[Code]...
I have a MovieClip. It represents animation of jumping monster. For clearness, let's pretend there are only 2 frames: the first one occupies top left rectangle (x = 0, y = 0, w = 70, h = 70) and the second one occupies (x = 100, y = 0, w = 70, h = 70). So monster jumps from left to the right. And position of MovieClip itself is constantly = (0, 0).
I'd like to fire some event when monster is clicked by mouse.
For some reason, I have stage mouse listener, not monster mouse listener. I wrote this code:
stage.addEventListener(MouseEvent.CLICK, onClick);
private final function onClick(e:MouseEvent):void {
const clickPos:Point = new Point(e.stageX, e.stageY);
// having monster:MovieClip, how do I check hitting it?
[Code] .....