ActionScript 3.0 :: Show MovieClip With Keypress Not Working
Mar 3, 2010
I am trying to make an interactive presentation, where you can push down on different keys and show different layers in my image. [URL]. If you open this .swf and press the "Q,W,E,R,T" keys you can see what I mean. It was working fine with the layers associated with the "Q W E" keys, but once I started adding more, I cannot press and reveal more than 3 layers at once (try pressing different combinations of three keys at once and you should see that not all of the layers appear, but each key works individually).
Here is my AS3:
Code:
import caurina.transitions.*;
mc_aerial.alpha = 0;
mc_01.alpha = 0;
mc_02.alpha = 0;
mc_03.alpha = 0;
mc_04.alpha = 0;
stage.addEventListener(KeyboardEvent.KEY_DOWN, mc_aerial_KeyDown);
function mc_aerial_KeyDown (e:KeyboardEvent):void{
[Code] .....
View 2 Replies
Similar Posts:
Mar 2, 2011
I have a simple catching game with objects falling from the top of the screen and when they are caught at the bottom I want a movieclip to appear with +5 to show the point scoring. I have set up a timer to show the mc then to delete it when it finishes. It all works apart from the mc will not disappear once the timer is finished. I have thrown a trace statement in to check that it is firing and that shows up fine. What the hell am I doing wrong? Here is the section of code:
[Code]...
View 2 Replies
Nov 12, 2010
I am a high school teacher who is teaching Actionscript 3.0 for the first time. I am teaching my students how to create multiple scenes to understand actionscipt interactivity. The first scene has a button. The second scene has something happen when a key is pressed. The problem is that the second scene doesn't work. Flash doesn't even show the trace command that a key has been pressed. Keypresses work fine when done in the first scene, but when put in the second scene after a button has been pressed, it doesn't recognize the keypress event.
View 1 Replies
Jun 21, 2010
I'm having a problem with PC applications. Notably, the keypress command no longer working when my app is fullscreen. It works just fine on Mac, but bugs out and doesnt recognize and of my KeyPress actions when fullscreen. When its not fullscreen, it works. I dont know what to do, as i need my apps to play fullscreen on both pc and mac.
View 1 Replies
Jan 28, 2009
[code]It works fine when I press the button but not when I press the enter key.Just to set the context I want users to be able to use enter to enter an answer into a grid before moving on to the next cell. My cells are all labelled A1, A2 etc so that I didn't get confused. As I am and will always be a newbie I couldn't figure out a function to do what I wanted so came up with what is probably a long winded way around: store the textfield instance name in an array and then call the item in the array in conjunction with setFocus - like I say it works when I click the button (which I intend to hide off screen).
View 10 Replies
May 25, 2010
Just run into an odd little problem. My project allows for the user to press numbers on the keyboard to call specific functions accordingly.It all works fine, until the user goes into "fullscreen" mode. When they are in fullscreen mode, keypress actions no longer seem to work at all. Have I missed something out with an EvenListeners? Or have I overlooked something entirely?Here's a sample of how the keyboardEvent is being used:
Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, keypress);
function keypress(keyEvent:KeyboardEvent) {
[code]......
View 2 Replies
Nov 7, 2008
I have a movie clip which I want to scale up on a key press and then when the key press is not pressed I want it to scale back down. simple right? but I cant do it? Once I have that sorted out I would like to take it one stage further by making this work: If a key is pressed and let go the movie clip scale up and then finishes. if the key is pressed and held then the movie clip scales up slowly but once the key is released the clip reverse back to frame one.
The file can be found here : [URL]
View 2 Replies
Feb 18, 2011
Im trying to make an interactive map. I have 32 cities in a metro area, and i want to have it bring up a message when you roll over it saying "this is the city click for more information". I also want to have it so when click it itll take you to a url for the web page that has the information.
But i cant figure out the how to make the buttons to work correctly or how to get the message to show up or how to get the url working. I've got the buttons down and i have the code down to click and go to url but it not working and i cant figure out how to get the message to show up only when you have the mouse over it.
View 3 Replies
Sep 1, 2009
I've got two preloaders that I've made from the same template, but I can't get the progress to show. It simply shows a quick glimpse of the finished image and then goes to frame two.
View 2 Replies
Jun 23, 2009
I'm having problems with a simple flash site that contains a scrolling slide show, that uses a .xml file.I was sent a .fla file that I couldn't open with MX 2004 ... I asked them to save it as a MX 2004 file. They sent it back, and I was able to open it.The problem is ... when I save it as a .swf the slide show doesn't work.The .swf & .xml files are on the same level in the directory, and the .swf path to the .xml file is correct, also the .xml to the image folder path is correct.I have spent hours going through this, and can't get it to work.I have added images to the .xml file, and they show up (I am using the original .swf) so the .xml file is OK, and again the path from .xml to the images folder is correct. This is the working .swf file (click on the portfolio link )Now ... imagine no images there, and that's what I'm getting when I save the .fla as a .swf.Other changes I make to the .fla are working properly ... just the slideshow is the problem.Did something happen when the .fla was saved as a MX 2004 that caused the .xml part to stop working?IM not a whiz at actionscript, but I have gone over it several times, and can't see anything that looks out of place.
//http://www.kirupa.com/developer/mx2004/thumbnails.htm
function loadXML(loaded) {
if (loaded) {
[code].....
View 0 Replies
Dec 29, 2009
I really hate when you read a tutorial from some "expert" and what it tells you to do is wrong. I was doing a tutorial for a XML slide show, and the last line of code doesn't work quite right:
[Code]....
For some reason that only sends the my_playback_counter to 1. And it just sits there twitching. So when I tried to change the tutorial code to:
[Code]....
View 3 Replies
Jun 30, 2010
i created a slide show with buttons, when i test it in flash it works correctly but when i put it in a html page, it does not redirect you to the page when you click on it.
View 2 Replies
Nov 4, 2011
I'm developing a new website one with a dynamic slideshow which can be found here. [URL] The problem is, after weeks of it working it all of a sudden now has issues loading the xml data into the swf. The swf loads but nothing displays in it, this worked and I changed nothing but updated the graphics which would display in it. If you hit refresh an untold number of times eventually it loads. To me this sounds like a server issue, but I'm not sure.
I've tried updating my flash player, updated the swfobject.js to the latest one I could find. I've made all my .js local on the server instead of calling externally to a source. I'm not sure what the problem might be. I've attached a working and not working example graphic to this post. I've tested this out on 7 different PC's both of which running either Windows 7 or Windows XP. Out of 7, 4 of them load the slideshow properly each and every time. 3 of them however loads it, but will randomly get the issue where it doesn't load properly.
View 3 Replies
Dec 3, 2009
I would like my dynamic text box to display the roots current frame. I have triedthis with no luck
frameNumberText_txt.text = currentFrame;
Im pretty sure the problem is because the text field needs a string value..
View 3 Replies
Feb 11, 2010
I'm trying to make a slide-show that adjusts to the width or height of the stage, and eventually, of the web browser window. I was able to load and resize a picture by writing code on the timeline, but I got the Error #1009 (Cannot access a property or method of a null object reference) when I put this slide show into another movie clip loader (which chooses between different swf pages of the website, with the purpose of keeping the swf file sizes down). By the way, my "slide-show" loads the picture fine. When I use the movie clip loader to load this "slide-show" it works too. Only when I use the Flash Player to open it, it gives me the Error 1009. I looked around on actionscript.org, and everyone seems to be recommending the folowing code (or something like it):[code]
I also ran into some information about document classes and I figure maybe I should be using document classes to make this stuff more modular and reusable. So I put my slide-show code into an .as file, importing all the flash.xxx.* classes, and put it in a package and class and constructor function... in the same directory as my swf file, and set it as the document class to a blank fla file. Then I tested it and all I got was a blank swf. This is without the Event.ADDED_TO_STAGE code. I guess I don't know how to get the document class thingy working either. So my question is, can someone tell me how I can change my slide-show code into a working document class without the Error 1009?r?[code]
View 1 Replies
Nov 27, 2009
I'm tryng to add a movieclip trough a class using this code:[code]the trace returns the position like if it was on the stage, but it don't shows up, its just not visible.
View 2 Replies
Jul 23, 2010
Im trying to show a new movieclip that only shows up when i press another one.
The movieclips to press are nested inside another movieclip so i need them to call the other movieclip which is in the stage.
To explain better menu1 is inside cont3. Menu_down is in the stage and i need to call it after pressing menu1.
Btw menu1 is showing an external swf also,is there any problem with it?
View 4 Replies
Aug 16, 2011
how you display a border around every MovieClip in Flash. I've done it once but I can't seem to find it at all. What happens is that a blue (I think) box is drawn for the bounding box of the movieclip, and it does this for every movieclip automatically, so I don't think it's creating a border manually for every movieclip you add.
In addition this box doesn't rotate with the movieclip, instead it is just a square that completely surrounds the movieclip. If the movieclip rotates, the square just gets bigger or smaller to match.
View 1 Replies
Aug 18, 2009
i would like to know if there is a way to hide only a part of a movieclip in flash. (i am not talking about putting a jpeg or a png over it to hide it xD)
View 5 Replies
Jul 28, 2011
Nevermind, I got it.
View 0 Replies
Feb 5, 2004
I am making a mp3 player, and i would like to have a "lamp to flash"(movieclip if posible) when i pause the player. My action script is until now this:
[code]...
View 7 Replies
Dec 6, 2009
I'm making a Flash AS2 Dress-up game and I want to show/Hide movie clips on release of a button like this one;
View 1 Replies
Aug 3, 2009
I am building a navigation menu with buttons that call and show a movieclip just below the button. I have no more compiler or output errors. Despite this, I still dont have a working navigation menu.The movieclips are only found in the library and are being called by buttons on the timeline. I currently have all the actionscript on frame 1 on a separate layer of the main timeline. None of the buttons or movieclips have code associated with them individually.The code I have created is as follows (I omited some bc the functions get repetitious).
Code:
stop()
va html_con_mc = new MovieClip
[code].....
View 2 Replies
Dec 9, 2009
I want a button to show and hide a movieclip (see attached files for source) the Button is a Movieclip and has been coded using a tut I got from some where but I am stuck on how I can get it to do the show and hide part <edited part> forgot to Add that I also want to make a Text box say Grid On and off
[Code]...
View 3 Replies
May 17, 2008
an example of a show/hide a movieclip with a listener. That is, i was planning to have a boolean flag variable showSubMenu and if it's true the submenu will be visible and if false it's hidden???
View 2 Replies
May 29, 2010
I want to replicate one of the Flasheff's function with AS2 script. The delay show function, where I can set how many seconds should a movieClip wait before it actually shows up.For example, I create 3 vector shapes on the stage. I convert them to movieClips (symbols). Instance names:
- one_mc;
- two_mc;
- three_mc;
When I test the movie, I want one_mc to show up right away, then after 1 second two_mc to show up, then after another second three_mc to show up, you get the idea.
View 4 Replies
Sep 24, 2009
I've been looking on google, but I have found nothing at all on this, which is surprising as it is very simple to make (I have done it in AS2).I was to have a button that can hide a movieclip. Then another button which will show it again.
View 8 Replies
Aug 20, 2010
I got this movieclip. With actionscript I attached a new movieclip to this one, as a popup menu, which will show on rollover. Inside this movieclip, it automatically makes textfields, as menu options (information I receive from a XML document). The problem is, that I cannot get it to respond on a onRelease function on those text fields, and I do not know why.
Heres the code for the textfields
Actionscript Code:
marray = explode(",",mn);
var sizes = 0;
for(var i=0;i<=marray.length - 1;i++){
trace(i);
mc.menu1.createTextField("txt"+i, i+59, 0, sizes, 100, 25);
mc.menu1["txt"+i].onRelease = function() {
getURL("[URL]", "_blank");
};
mc.menu1["txt"+i].text = marray[i];
sizes = Number(sizes) + 25;}
I tried to make a onRelease on one of the links, but it just wont work probably.
View 7 Replies
Nov 8, 2011
I am new to flash parameters but from the research I could find so far it seems that this should be fairly simple. I have a flash file that has a movie clip in it. In this movie clip there are two movie clips. What I need to do is show a one movie clip and hide another. I basically only need to set up the reading of the flash parameter code in flash...
var imageToShow:String;
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
This is basically what I have... I'm not sure what to go on to next or if this is even correct.
Code:
if (parameter == "image1") {
image.image1.alpha = 1;
image.image2.alpha = 0;
}
View 2 Replies
May 12, 2011
Basically I have a movie clip that comes up on the stage and plays to frame 230. I have placed a stop(); inside the movieClip on frame 230. I would like to have a continue button come up outside the movieClip on the stage when that movieClip reaches 230.I was hoping this would work but I am having trouble. This code is on the stage level outside the movieClip.Both the continue button and the movieClip are on the stage.
if (movieClip.currentFrame == 230){
continueBtn.visible = true;
} else {
[code].....
View 1 Replies