ActionScript 3.0 :: Sync Multiple FlvPlayback Instances On Stage?
Jun 7, 2011
i have 4 flvplayback components on stage loading 4 different videos. How do i sync them?
I have ensured they are all fully buffered i.e fully loaded and then play them all at once. But they keep getting out of sync. I.e i am checking the sync with the playheadtime. I had written an timer/enterframe event to check for out of sync at and pause and seek times to the fastest playing player . But this happens for every second. i keep gettting a very jittery video with breaking sounds due to the constant pause /seek / play cycle.
How can we sync multiple flvplayback videos properly.
I am using AS3 with CS5. I created a flash project which contains multiple instances of flvplayback. Each plvplayback plays a separate video and each has its own controls. It all works fine when playing, pausing and controlling the videos. The problem is with the fullscreen functions. If I click the fullscreen button on the first flvplayback, it makes the second video go full screen. If I click the second video fullscreen button, it opens fine into its own video except when I do it three to four times. After three to four times of toggling fullscreen on the second video, it opens the first video into the browser larger than its original size but not full screen. I have tried recreating the flvplayback instances by re-importing the video files. Each flvplayback has been given its own instance name. Even when I create a separate custom button, not part of flvplayback, and give it the command to launch fullscreen on the first video, it still opens the second video to fullscreen. When I use just one video and remove the other ones, toggling fullscreen works fine for that particular video.
i have one FLVPlayback instance on the Video page and another on the Discography page...when i navigate away frm either of the two pages, i need the loaded flv to stop playing... so i've used the following code for my navigation buttons : (the navbar is a movieclip on the maintimeline...video_mc and discog_mc are also on the main timeline... flvPlayer is the instance name of the FLVPlayback component..)
Code: stop(); //setting destination frame label variable var destin:String;
there seems to be no accepted method of playing multiple flv using buttons. My latest attempt has me putting multiple instances of the flvPlayback component in different frames and using buttons to navigate to those frames. It works but nothing anyone has posted anywhere will result in removing the flv when you go to a different frame and instance. This was simple in AS2. Load movie to a traget and each time you load a new movie the other one goes away. REALLY goes away.
I didn't find any solution in the past discussions, I want to sync two FLVPlayback in the stage.Now I quickly solved with a Countdown of about 10sec;one can choose a project from a ComboBox and the two FLV play when the countdown reaches 1. That's not the right way as they never play in sync the first time..
I think a BufferingBar can do the job, detecting the end of the buffer. but I don't know the code to add...
I have a movieclip that gave a class name and set everything to export into action script. Now, I would like to put multiple instances of that same movieclip on the stage. I would also like to be able to keep track of them individually. Would I need to do something like create a for loop and have it run however many times i want that movieclip onstage? If I did that, how would I be able to manage them? Would I also give them names in the for loop and have a var that goes ++ every time it loops, then attach that var to the end of the name I give it.
I understand how to import a swf and add it to the stage. Is it possible (using code) to add the one imported swf to the stage multiple times, each with different instance names? So the same as adding a library item to the stage multiple times, each time with a different instance name, with code, but using an imported swf?
I'm creating a game in ActionScript 3.0 using the FlashPunk game engine and the FlashDevelop SDK. I've created my own MovieClip class that takes a preloaded movie clip file.
public function MyMovieClip(file:MovieClip, posX:int, posY:int, frameRate:int) { movieClip = file;
[Code]....
The problem that I'm having is that when I have multiple instances of the MyMovieClip class using the same swf file, only the last instance is rendered and is updated for each instance of the class that I have.(e.g 3 instances of MyMovieClip, the last instance is updates at 3 times the speed.)
I'd like to create a chain of objects (either movie clips or sprites) that move left to right across the stage continuously. I know I can create two movie clips that contain a series of several 'chain links' and are each a little wider than the stage width. Then I can move both clips across the stage and when the first movie clip is completely off stage reset its x position back to 0. Likewise, when the second clip is completely off the stage on the right, reset it's position off the stage to the left.
This works and gives me the basic effect that I want by creating this uninterrupted moving chain, but it doesn't seem like its the most efficient way to achieve this. What I thought would be more efficient would be to create each link in the chain separately from an individual mc in my library by programmatically adding new instances to the stage.So, I created a single chain link mc and set its export linkage to 'Link' and left the base class to flash.display.MovieClip. Next, I placed the following snippet of the code on the first frame of my movie:
I'm having issues with something wanted to accomplish involving qued amations that i can reuse in various situations throughout an application...
Basically, what I'm trying to get is a prototype or function that will allows for multiple instances on that stage that start at a specific x/y and size, animate to a specific x/y size and end at a specific x/y and size... the x/y and size information is defined for each of the instances in the function.
A good place for this would be with buttons... check the sloppy diagram attached.
I have an arbitrary number of object instances on the stage. At any one given time the number of objects may be between 10 and 50. Each object instance can move, but the movement is gradual, the current coordinates are not predictable and at any given moment I may need to retrieve the coordinates of a specific object instance. Is there a common best-practice method to use in this case to track object instance coordinates? I can think of two approaches:
I write a function within the object class that, upon arbitrary event execution, is called on an object instance and returns that object instances coordinates. Within the object class I declare global static variables that represent x and y values and, upon arbitrary event execution, the variables are updated with the latest values for that object instance.
I'm using this AS to load multiple external images into mc instances on a stage, using different loaders.[code] The external images always load from the upper left corner down, how can you make the image load from the center of the instance on stage?I found this code below and doubt it will work for me since I have 5 mc instances on different parts of the stage, so the stage wouldnt be a good reference point.[code]
add multiple instances of an object to the stage at different but not random points.
For example - I have a box that is linked to a class file. In the class file I have an "ADDED_TO_STAGE" event listener. The function that is called places the box at a certain position on the stage say.... x=100, y= 200.
In the document class I create an instance of it like so -
_box:box = new box(); addChild(_box);
Now what I want is to create multiple instances of box on the stage every 5 seconds. But I don't want them all to spawn at (100,200) on the stage. But here's the catch, I don't want them to be random spawns either.
for ex- I want the first instance of box to spawn on (100,200), then 5 seconds later, the second instance to spawn at (200, 800), the third at (100, 500) and so on.
Would it be possible for me to create objects on the stage to serve as reference points for where i want the instances to spawn instead of writing the exact co-ordinates?
I am trying to create a Flex application with a shared viewing experience for users watching video. Specifically, there are a group of users in a virtual room, and one of them is the remote holder. One approach is to have everyone have a video player, and then use our own protocol sent among the different Flash player instances to make sure people are in sync (we have our chat routed over XMPP for the people in the room).
However, we were wondering if there was a simpler way to do it using Flash Media Server. Is it possible to create a synchronized viewing experience in FMS where everyone is always at the same point in the video? And is it possible for 1 person to then have control over that stream (e.g. pause, play, seek, etc.) for everyone connected to that stream?
I'm trying to synchronize 5 mp3 (128kbs 44hz stereo), each one in a different SoundChannel, and some animation. I've red a lot about the variable delay of the soundChannel, and how the "position" property return where the soundchannel should be, and not where it actually is. But I didn't find any real solution to these issues.
For the moment what i'm doing :
- load the 5 mp3 in their soundChannel
- start the soundChannels
- put a timer to check the first soundChannel position to change the animation
I've tryed to solve the delay between the soundchannels by resynchronizing them after a few seconds to the first soundchannel position, but it's only getting worse.
I'm using Flash CS4 / AS3 but I can easily go back to AS2 if needed. And I can embed the mp3 in the swf or using any other audio format.
I need to build a website which shows multiple instruments in a band, being played in sync. Each camera/video block is a different instrument, and played together, they constitute an entire band. I have been searching high and low for ways to do this, and it definitely appears that HTML5 is out. It looks like standard FLV progressive download is out, too, because it's impossible to get 4-8 videos to sync perfectly.
I see on the FMS page that it has some abilities in synching. How would one (conceptually) go about making a webpage where say 4-8 videos begin to buffer, then when ready, play in sync? And they would also need to, when the location is changed, all sync to that location and rebuffer.
The objective is so that the user can mute/solo each video's audio, to remove an instrument(s) from the "mix" at any time.An alternative way of doing this, I think, would be to just put the 4-8 videos together in video editing, and encode this into one video, but have each video's audio track be a separate audio channel. If FMS can do multichannel audio on one video, this might work, if it could mix them in/out individually, as the user requires.
I'm about to create some art installation using augmented reality and music. I'd like to implement some kind of sampler in it, but I can't find any way to do it.
It's gonna be a looper, I've got 12 files (each 8 seconds) and I want to play them synchronized - so they must start at the same time. this is example of something similiar to my project[url]... They must be controlled by changing volume (0 means off).
I'm using the code of the -Web video template: Dynamic video playlist- (with no thumbs)and a ComboBox on the stage. It's OK but I need a help to understand how I can use 3 FLVplayback and 3 XML playlists.Since I can't use multiple classes in a .fla and since I need only one ComboBox that triggers all the 3 FLVplayback with their own XML playlist..
ActionScript Code: stop(); var xmlRequest:URLRequest= new URLRequest("graphicImages.xml"); var xmlLoader:URLLoader = new URLLoader(xmlRequest);
[Code]....
So I figured that the coding of separate scenes would work independently of one another, but I guess I was dead wrong, because when I apply this to a different scene and change the XML path for a different set of images, I get all sorts of conflict errors when I test the entire movie. I have my flash film set up so that each link send the user to a different scene, which plays a unique intro for each, and then the slideshow appears on screen and the viewer can navigate the images.
Is there a work around for this? Or am I going to have to break my flash movie into separate movies? Or should I just add a suffix to all my vars and functions so that they are unique for each scene?
whenever I set my sound to stream and continue to make a movie with multiple scenes. The audio and video get disgustingly out of sync sometimes even off by 30 seconds. I just started an animation its only 10 seconds long with two scenes and the AV is already off by about 5 seconds. Ive worked around this by avoiding scenes altogether but i really don't want to have another 5000 frame scene. I discovered this problem in Flash MX and Im quite annoyed that it still has't been fixed 3 years later!
I am working on a piece of software that was written by someone else (that person is no longer available, but part of my job is repairing/maintaining this software).The software has multiple pages, each is a swf that calls loads and plays an FLV file. I've noticed that the audio is inconsistent after multiple runs.For instance, I'll repeatedly run the code in the Flash player by pressing CTRL + E in Adobe Flash (so no html yet). No changes to the code or anything, just play once, close the Flash player, immediately play again, close, and so on. The first few times, the audio loads and plays with no problems. After a few runs, I've noticed that the audio no longer plays.
I put in trace statements to see the state of the player content, and while when it runs correctly, I'll get the usual "playing", "connectionError", etc., on the times when audio does not play at all, the state is "undefined," like the player content was not created.Again, to clarify, this happens with no change in code or file locations. And the problem is always apparent as soon as I run the swf, because on the first page the state is "undefined" if the audio doesn't play (so in other words, it's not like one particular page breaks it partway through). From what I see there is also no persistent data that should carry over from one execution to the next.
I'm doing a small Flash 10 site for a friend of mine at [URL] and my problem is if you click on the WATCH button, you'll see the FLVPlayback component comes up and the video starts playing. Fine so far. However, click on any other button and it takes you to the correct place in the timeline but the audio from the video keeps playing and I can't get it to stop even though the FLVPlayback component is nowhere on the stage anymore. How can I fix this bug?
i have set up a flvplayback instance and when a button is clicked i want it to load in and play a new flv
i have the following code:
// Add FLVPlayback Class (required for Playing flv's)import fl.video.*;// Create a new FLVPlayback object to hold the video var myVideo:FLVPlayback = new FLVPlayback();// set the width of the videomyVideo.width = 544;//set the video's widthmyVideo.height = 304;//set the video's heightmyVideo.x = 200;//set the video's horizontal positionmyVideo.y = 88;//set the video's vertical position// set the video source to the current video stored in the variable myFlvmyVideo.source = myFlv;// put the video on the stageaddChild(myVideo);
all this works fine and the first flv loads and plays fine no problems
[Code]...
I know how to use netstream but unless there is a way to use skins with it its not the way i want to go.
I am building a video player which should load multiple videos in a FLVPlayback. When the loading of the first video has finished, the second one should start, using the VideoProgress Event.
My code looks like this, videos is an array with the paths to the videos:
flvPlayback.addEventListener(fl.video.VideoProgressEvent.PROGRESS, progress); flvPlayback.addEventListener(VideoEvent.COMPLETE, onComplete); private function progress(e:fl.video.VideoProgressEvent):void
[Code]....
Now I have the problem when I test this locally, the first video is invisible sometimes when starting to play. This is not happening everytime, but sometimes the video is not shown, but I can hear the sound, and I can see the scrubber on the seekbar moving.
I already tried to check in the progress function if the video is already playing, and if not, set a timer that will call the progress function again in 1 second.
I am trying to remove an FLVPlayback from stage at its completion and gotoAndPlay a mc from my library. Nothing seems to work. I am using CS4 and as 2.0.Here is the code im trying to use now to load and remove FLVPlayback
I am unable to add the Action Script 3 FLVPlayback component to my stage or library in Flash CS5.5 when working with an action script 3 document.
Under components in the video folder i click and drag anyone of the FLVPlayback components (FLVPlayback, FLVPlayback 2.5 or FLVPlaybackCaptioning) to the stage and nothing happens. I am unable to add it to my library as well. All the other actionscript 3 components under the Video folder work. (BackButton, BufferingBar, CaptionButton, If I create an actionscript 2 document the FLVPlayback component drags to the stage and adds to the library just fine. So this appears to be an actionscript 3 issue only.
I have 2 other employees in my office using the same product and none of them have this issue. Only me.
I have tried to uninstall the product and reinstall but nothing helps. I have Flash CS3 installed on my PC and the product has the same symptoms as the Flash CS5.5 trial version that I am running.
I did not try this with Flash CS3 before I installed the CS5 trial. So I do not know if it worked prior to my CS5 evaluation.
I imported multiple flvplayback videos on my file via the Video Wizard Import. After that I removed all videos except one. But it's still trying to load those old video and the skin of their player when I preload the file. I am sure there's no player on the stage except the one I need. And when I need to play the file, it's working well, the only problem is the extra loading for 6 skins that I don't use anymore and the time to look for 6 videos that are not there. So here're my questions;
1- When you import a video via Wizard, it there a script hidden somewhere that can be found? 2- When you import a flv to the stage, there's a loading bar saying getting metadata. Is there a place to edit or erase this metadata? 3- Any other ideas of where I could look to find this hidden data or trace or ghost that needs to be remove from the file ?
i have a movieclip that is instanced on stage everytime i press space. problem being i can't seem to get it to hittest anything other than the first created instance.my spawn mc code is
Code: function dropbox():Void { //trace(me); this.attachMovie("box","box"+Math.random()*300,this.getNextHighestDepth(),{_x: _root.one.me._x-25, _y: _root.one.me._y});
[code]....
the first one returns "It's working" but zip for all of the others.