Professional :: Using Keyboardevent -file To Immediately Go To And Play A Frame Labeled "waterdepth"?
Oct 8, 2010
In my file, I have an introduction playing over and over. When someone hits the "K" button, I need the file to immediately go to and play a frame labeled "waterdepth". What am I missing below? I keep getting an error saying that "keyboard event cannot be loaded."
I have 5 instances of a movie clip that need to move to a frame labeled "highlight" on Rollover and to a frame labeled "unhighlight" on Rollout. On Release each needs to get a different URL. I got it working, but the script is pretty repetitive. Can someone show me how to shorten the script by creating a function or something similar that would handle the rollover and rollout part? Code for two of the movie clips below.
I'm making videos for an instructional program. This involves importing audio, images, animating those images, etc. I'll be exporting to flv format at the end, and then converting them to MP4 for downloads online.H
1.) Should I be using ActionScript 3.0 or ActionScript 2.0 for this?
2.) When I try to import audio, the whole audio file doesn't show up immediately in a new layer that I've created. It only goes in the blank keyframe that I've inserted. How do I import the audio so that the entirety of it shows up?
I've got a button that I want to use to jump to a labeled frame within the timeline. When I click on the button I can't get my trace statement to work. The error message I get is: Error 1061: call to a possibly undefined method addEventListener through a reference with a static type flash.display:SimpleButton BtnDone is the instance of the button on the stage, btn1867 is the frame label I want to jump to once the button is clicked.
Here's the code: stop(); btnDone.addEventListner (MouseEvent.CLICK,clickSection); function clickSection (evtObj:MouseEvent) { //trace action - what's happening in output window trace("The button 1867 was clicked!") gotoAndStop("btn1867"); }
I'm trying to load a value from a .php file labeled $average into a dynamic textbox. I'm using this code to accomplish this, but I only get "undefined" in my textbox. Can anybody see if there's anything wrong or just a syntax error, or anything..
I'm using actionscript 2, I've got a preloader working, but now I'm struggling to make an alpha animation play immediately after the preloader. My attempts have ended up with the animation playing during the preloader.
I have my entire site layout in Flash CS4 and using AS3. I was able to successfully segment the site with labels, add UI Loaders to desired sections to make the site smaller and work faster, I was able to put a close button above the UI Loader, which closes it and brings a user back to a designated section of the site.
And then I encountered a problem. I have a few images in each UI Loader which I would like to function as buttons and also bring the user to the desired section on the main site, however it seems to be a problem that the buttons are located inside the UI Loader I can not figure out how to jump out of the loader to the main site.
Is there a specific code for it or the whole layout has to be somehow restructured?
I'm building a flash application where the user can play multiple 30 sec .flv movies (one at a time) in slowmotion by pressing or holding down the left and right arrows keys.The user can hold/press "keypress right" to move to the next (key)frame and "keypress left" to move to the previous (key)frame in the .flv files.I have tested embeeding one .flv movie to the stage and it's working fine.But since I will be using many flv's I want to load the .flv's dynamiclly (on button clicks) using netstream or FLVPlayer. Would it be possible to step beetween keyframes in the same way if the .flv's are loaded dynamiclly? Or, must I embeed each .flv file into separate swf's and then dynamiclly load the swf's to my main stage?
Who'd have guessed it, my SWF plays immediately with FF, but I'm getting long delays with IE8. I've come a long way from when I started this project. I think I have everything in the right place and have the right files to work with.
I'm using SWFObject 2.2 think I'm using it properly. I used the generater (air vers.) to generate the html file. The file now plays and I have a background that displays right away (it's an image of the what first shows up).
where I can improve: [URL]..I've compressed all the images, but the file is still rather big. I expected problems with FF, but it plays immediately .
Using CS5 and Code Snippets, how do I tell the Timeline that when it gets to a specific frame to go to another one? I want it to go back and play the first frame to create a looping effect.
I put together a rather simple interactive .swf file using graphical "buttons" to navigate through different screens. Afterwards, I was told to add in two keyboard events as well: one to navigate to the next screen and one to restart the .swf file.
Using the keyboard to navigate the way I explained above works fine--that is, until I use the mouse to click on a button. Once I do that, the keyboard events no longer work. For example, if I start off the .swf file by pressing the Space bar on the keyboard to navigate to another page, it works fine. If I then press the "R" key on the keyboard to restart the .swf file, that works fine as well.
However, the first time I click on one of the buttons on the stage to navigate to another screen, the keyboard events no longer work. I can press the Space bar, and nothing. I can press the "R" key to restart the .swf file, and nothing. It's as if using a mouse event disabled the keyboard events or made the .swf file stop "listening" for keyboard events. The only way I can get the keyboard events to work again is by clicking somewhere on the stage and THEN pressing the appropriate keyboard key. I'm guessing that's because I put the focus back on the stage, maybe?? (again, not an expert here)
My code is ridiculously simple, and it's on the first frame:
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey); function onKey(event:KeyboardEvent):void {
[Code]....
Is there anything I need to do to this to make sure the .swf file is always "listening" and registering the keyboard events?
I'm trying to create a "back" button, but when the user clicks on this button I want the animations to go in reverse and then go to the frame that it is calling. so for example i have 5 notes, what happens first is that "note 1" is on the stage then you click on 'next' and then "note 2" slides in from the bottom and pushes "note 1" up and out of the frame and stops and shows 'back' and 'next' buttons. what i am trying to do is, if the user clicks on 'back' , I want the movie to rewind and have "note 1" slide back down. Or if they click on 'next' 2 will be pushed up and 3 is revealed the same way 2 came in.
I have discovered a bug with KeyboardEvent.KEY_UP keyLocation values for the shift keys. how to reproduce this:
1.when no other keys are down the value for left shift is 1 and for right shift is 2 for KeyboardEvent.KEY_DOWN and KeyboardEvent.KEY_UP
2. when you have pressed shift and then press another key - when releasing shift the value for left and right become 0.
There is absolutely no reason why these values should report anything other then what they initially reported on key down as each key fires its own event with details for each , regardless of any key combinations. Im using cs5.5 windows 7 basic.
I have the loading audio file at frame one. However, I want to play the audio only at specific frame or frame label. How do I do that? Below are my codes:
Quote: //start of sound section is for sound var soundReq:URLRequest = new URLRequest("FlashFiles/audioFiles/mySoundmp3"); var sound:Sound = new Sound();
[Code]....
The above plays the sound as soon as the .swf file is loaded. But I want to play at certain point in time, say frame number or frame label. I want to be able to put all my action script on frame one (or one location) instead of all over the time line.
Create frame at frame 1 Insert text Insert keyframes at two different points down the time line Change the last frame to what I want it to morph INTO Break apart all keyframes, and Insert shape tween in between the first and second, and second and third keyframes.
When I go to play the movie, it flashes the text that is in the last frame ONLY.
I have a flash file with several frames. In each frame I need to play a sound file.I've added all the sounds to the library and done all the necessary steps to export for actionscript.Here's my code to play the sound in one frame.
var sound1:Sound = new Cal10101(); sound1.play();
This works great to play the sound. I am using buttons to move to the next frame. When I click the button to move to the next frame, I need the sound from frame 1 to stop and a new sound which would be Cal10102 to start playing.How do I stop the sound from frame 1 from playing when I go to the next frame?
I have 2 flash files, one with an intro and the second that just has a document class file that plays out a snake game. How could i import that document flash file and make it play out on like frame 100 off my other flash file.
I am working is CS3 and am experiencing problems changing the first frame on a graphic symbol. When I type in a new number it jumps back to the old one. When I try to change play once/loop/single frame setting it jumps back to the previous setting. I am trying to simply modify this on a keyframe in the symbol's layer on the main stage. I've experienced this on multiple occasions, but can't get the workaround this time. I know I can do what I am attempting. In fact, I do it at a couple of spots earlier in this symbol's instance without problems.
Unfortunately it ignores the second line, which appears to be because the movie hasn't loaded by time it gets to the next line. As a work-around I made an interval to check for the movieclip width to be more than 0 and then run a function that chooses the desired frame, but this is very unreliable. Is there a simple way to load the clip and wait until it is finished, then immediately choose a frame on load?
I have a slash template that I will be inserting video into, the template is set up for a .flv file ? what would I change in Dreamweaver or Coda to edit this file so that it can play video with a .swf file instead of a .flv file? here is the template
im having problems with my swf file,its not playing on the web,my video is a flv i save it a swf when i export it and it wont play. it plays pefect on my desktop though.
On the homepage [URL] I had a previously installed .swf that works fine on IE, Firefox etc...I added a new .swf "testimonials" on the page on right hand side but it will only work in IE?
I have a problem where i cant get swf files to play online. I can get other swf file to work on my website but not the ones i am making. how i make an swf file able to play online.