Actionscript 3.0 :: Sound Event Listeners - Load Some Of Flash Movies A Bit Faster
Apr 16, 2010
I am trying to load some of my Flash Movies abit faster. I had read somewhere that i should use certain commands to bring the sounds out of the library after the SWF or page is loaded. I think i am suppsed to use Event listeners or call on the sounds somehow?? Does anyone understand what i am saying OR have any tutorials or links to tutorials that i can look at with regards to calling sounds?
I have a button, that when pressed loads a movie - works fine. What I wish to know is if it's possible (and how) to nest or add a function so that another movie loads at the same time. I'm using MX.
The idea is that when the 'good movie' is loaded, another small movie will load beside the button to indicate the active section.
Sample of what I'm currently using to load the 'good movie" is below.
There are actually seven such buttons in the main movie. So, for each one I want to replicate the adding of my external active.swf file into another empty movie clip.
Now, the above code works and pulls up the animation. When I tried to added another function to the button, only the second function worked (i.e., I got the symbol for indicating active state, but not the image gallery I've made).
I've created a flash interface with action script and the whole shebang for the web. It takes hours to load and I've seen sites with even more pictures and information load faster. I've compressed all my pictures and implemented various UI loaders to spread the load time out but it still takes a while. Does anybody have any tips and tricks to make my flash load faster?
this was my first application iam using flash ,whatever i created is working faster in my local machine while iam upload that in website its becoming very slow in loading that .
I have an intro.swf file that is basically a movie with sound that is exported for actionscript but not exported in the first frame. I just stuck it in a movie on my timeline and it works great and the preloader works because it doesn't load the sound before the preloader. I use :
musicSound = new Sound(); musicSound.attachSound("music"); musicSound.start(); to play the sound in intro.swf.
However, now this intro.swf gets loaded into an index.swf and everything works fine and the sound plays as long as I have the sound included in BOTH the intro.swf and the index.swf and the sound is exported on the first frame in the index.swf. I was hoping I could remove the sound entirely from my index.swf since it already loads into the intro but so far
In my Flash project I have a movieclip that has 2 keyframes. Both frames contain 1 movieclip each.
frame 1 - Landing frame 2 - Game
The flow of the application is simple:
User arrives on landing page (frame 1) User clicks "start game" button User is brought to the game page (frame 2) When the game is over, the user can press a "play again" button which brings them back to step 1
Both Landing and Game movieclips are linked to separate classes that define event listeners. The problem is that when I end up back at step 1 after playing the game, the Game event listeners fire twice for their respective event. And if I go through the process a third time, the event listeners fire three times for every event. This keeps happening, so if I loop through the application flow 7 times, the event listeners fire seven times. I don't understand why this is happening because on frame 1, the Game movieclip (and I would assume its related class instance) does not exist - but I'm clearly missing something here.
I've run into this problem in other projects too, and tried fixing it by first checking if the event listeners existed and only defining them if they didn't, but I ended up with unexpected results that didn't really solve the problem.
I'm pretty new/bad at actionscript (3) for web. I have a site up for a client/friend [URL], but it takes FOREVER to load. I'm under the impression that a good way to make the site load faster is to load in swf's externally. Right now, the site, in its entirety, is one big movieclip. I have large images (movieclips) for background images. If you look at the site and are kind enough to wait for it to load (aprox. 45 seconds or so) you will notice how the background image changes when you click to go to each section.
I am trying to find a way to load in the background as external .swf's to cut down on the initial load time. I'm also open to any other ideas. Below is the as3 code for my buttons/how they direct the site. I'm hoping to use a similar/generic style to load the background images. I'm hoping to load the movieclips underneath the rest of the site, and use the same naming scheme (e.g. homeBTN.swf) to keep it organized.
I've done most of my code in as3, working from either document class or classes. I've never done action script from within the actions panel (within Flash cs4). My question is do I need to follow the as2 manual in order for majority of code to work ? for example. If I want to do a loop. I can't do a
addEventListener(Event.EnterFrame,loop); I have to do varible = onEnterFrame()
I have this problem with mouse events simply I added two listeners on a movieClip that simply contains two keyframes 1 and 2 the code is in external class file of the movieClip
[Code]...
but when it goes to frame 2 it does not answer the moseUp event and stucks in frame 2
When I tried to import music to flash animations I have created, I received error message that: One or more files were not imported because there were problems reading them.
The platform: Mac AA audio file Encoded with iTunes 10.1.2, Quick Time 7.6.6
Is it because of the audio file format that music cannot be imported? If so, how can i convert it to the compatible format?
i made a SWF which contains a loader which loads any SWF file passed to it... the problem I'm encountering is that for some SWFs, some event listeners doesn't fire anymore... my own SWF file (which contains the loader) doesn't really have any other element except for the Loader object and so I cannot understand what seems to be preventing the loaded SWF (loaded by my Loader) from receiving some mouse events
it seems that the for the SWF where I'm having this problem, the listener seems to be tied up to a location in the stage or somewhere else, and so whenever I resize, the listeners is not responding on the right place, for example, the button appears on a certain position but the listener's hit test or whatever the SWF is using to detect the mouse click is positioned somewhere else
looks like flash has few issues when using transparent mode on different browsers players. Adding and removing eventlisteners on buttons are acting different. In some players everything works OK. FF and Chrome, but in IE, one of my buttons triggers the function even after removing its listener. Is this known issue, and is there any global set I can use to prevent this?
I'm trying to make a flash version of those refrigerator magnet poetry kits. As such I have about 150-180 little MCs each with a different word. They are all named sequentially, so theoretically I could just make some array counter or something to stick the handlers on right?
The problem is I get Error: Error #2094: Event dispatch recursion overflow. Why does removechild keep getting called if this.parent does not exist? Why doesn't removing event listeners work?
Can event listeners only be added to the class which dispatched the event? I ask because I want to have the logic for the listener on the main class, and the action is dispatched on click from a thumb which is instantiated in a scroller class. Kinda like this:
ActionScript Code: pseudo code: class main { main() {
[code]....
This doesn't work. Why can't the main class listen for an event on the thumb class?
I have a parent SWF (Parent) that handles user navigation between multiple children SWFs (Child_1, Child_2, Child_3). How do I add event listeners to the navigation buttons on the children SWFs so that the user can move laterally between Child_1, Child_2 and Child_3? I can think of two options but can't get either one to work:
1) The parent SWF sets up the event listeners when it loads a child. So, I use a loader on Parent to load Child_1 and in Parent add eventlisteners to Child_1.myNavigationform.myButton.
The problem here is that the Parent is only handing the loader instance and I can't think of how it would drill down to the individual objects within Child_1.
2) Child_1 adds the event listeners to its own objects. This just reverses the problem. Child_1 has no problem accessing its own buttons but when a user clicks them it has no way of accessing methods on parent so that Child_2 can be loaded.
I am creating a site with lots of big scrollable text-boxes in it. Each text-box object contained some text, and two buttons to scroll up/down with. The scroll buttons each had an event listener so the text moved when you clicked them.
These text-boxes were stacked on-top of each other with all except one having an alpha of 0. If I wanted to change which text-box is active I move it to the front and call a small TweenLite animation.
To the left (outside of the text-box objects) I have an object similar to a menu. It also has about 12 or so event-listeners (one for every button).
This turns out cause A LOT of lag an it's very troublesome for my laptop to run it. reduce the number of event-listeners on the stage and also the amount of text-boxes.
What I was thinking was to add the text-boxes using AS so I only have 1 on the stage at a time but I couldn't figure out how to do it. I also thought it might be better to just use 1 big event-listeners and from mouseX and mouseY decide which button the user is trying to push.
I have some MovieClip class that has eventListener, added from inside the constructor of the class (it's MouseEvent.MOUSE_DOWN). Now, I want to add the same listener externally, from parent class, for other purposes. Will these two interfere with each other or it's okay?
I have been creating mini product movies in Flash using sound recordings, key frames, and tweens. This is the 5th in the series, and just NOW I'm having problems.I had my frame rate set to 30fps with one long sound bite, about 2.5 minutes. Everything looked fine on my end, but when I loaded it into a landing page in IE, everything was out of sync, but only on other people's computers. It still looked fine to me.
I compressed the sound file more, which helped some, but did not aleviate the entire problem. I noticed the frame rate when I did a quick preview (just pressed enter) would fluctuate from the 30 fps all the way to 9 fps.I then cut the sound bite up into 13 segments,shortened the tweens, and reduced the frame rate to 18fps. In development and in preview, it looked fine. However, when I put it into the landing page, the animation was way too fast for the sound and the sound bites looped.
I want to make a little game. What I need is to add event listeners to all of Tank objects inside the Battlefield instance. I just can seem to figure out how.
My question is, does a better, faster CPU necessarily equal faster SWF compile times? Or does it rely on something else (OS, memory, etc). I only use AS3 and some of my projects take a while to compile. If certain hardware can guarantee me a faster compile time, it'd be worth including those things in my shopping list.
I can make a normal preloader, with a bar and percent shown and so on... But I want to make a little thing in the middle of the preloader that rotates faster and faster when the percent loaded goes up. This is what I thought would work:
I'm having a sound object being loaded. And I want that for as long as it is buffering to have it written in a textfield "loading..." and when it starts playing to write in that textfield the name of the song. And i want this to happen everytime the buffer needs to load and everytime the song resumes play state.
i've been kinda notified about loading external SWF's into a main time line and then some how positioning them where they are suppose to be. But heres my problem. My site is set up much more different then the typical flash website. the
ActionScript Code: gotoAndPlay(50) to go the certain links isn't on the main time. Its actually in a movie clip on the main page that when you click expands out and you can hover over/out of the links and all they do is show a little bit of content. I'e looked at what has the most MB's and it is my background. Just because it is very large. like 22 INches large. (It is scrollable with the mouse) But the background stays constantly there through out the whole time the user is on my website. How would I make this site load much faster. It takes like 5 mins to load my website.