Recording and playing back swfs
I'd like to provide a users on my application the ability to record and playback what was on the swf. I can see how to capture from the camera but can't see any way to record the swf and save it as a swf (without each user buying a screen capture package).
So I thought I might just record the basics (x,y,height,width,depth,alpha,rotation) of all the major MCs in the display list several times a second, save the details in an array and then allow the user to play the array back, creating and destroying MCs as necessary. This would be sufficient and quite efficient.
The problem is when I loop through the display list looking for the 'object.name' of each mc I just get 'instance1, instance2' etc. I can't use that to extract the appropriate MC out of the library when I playback. How do I get a consistent name that refers to the item in the display name and the library item that I can use it to put it on stage?
Also is there a way to create a list of all the MCs in the library?
Just assign the objects names when you create them then use getChildByName to retreve them.
f
import flash.display.Sprite;
import flash.display.DisplayObject;
var container:Sprite = new Sprite();
var sprite1:Sprite = new Sprite();
sprite1.name = "sprite1";
var sprite2:Sprite = new Sprite();
sprite2.name = "sprite2";
container.addChild(sprite1);
container.addChild(sprite2);
var target:DisplayObject = container.getChildByName("sprite1");
trace(container.getChildIndex(target)); // 0
Similar Messages
-
Hi, I have question about recording and playing back.
I am going to record by AudioQueue and to play back by MPMoviePlayerController.
My code can record by AudioQueue.
But, It can not record After playing back by MPMoviePlayerController.
Is Anyone who had same problem and solved it.
Please tell me resolution method.Hi
Welcome to Apple Discussions.
We don't get very many questions about Core Audio here so if you don't get any response, you can try the Apple emailing list for Core Audio:
[email protected]
The list is very friendly and I'm sure someone there will be able to answer your question.
Bob -
How to fix the signal from the microphone to the computer when recording through an interface in logic pro? Every time i record and playback i get poor signal and a lot of fuzz.. how can i fix this problem?
Which model computer?
What operating system? -
Recording and Playing back Streaming Audio and Video
Hi Folks...
I posted this in another forum too. I have this sample code from the e-book: "Learning Flash Media Server 3". The purpose of the code is to create a FLV. The code is not running as it should. When I click on the 'record' button, the label is to change to 'recording', that dosen't seem to happen and also when I click on the 'Stop Record' button, I get the following error:
"TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MinRecord/stopRecord()"
I have my suspicion on a certain section of the code as the possible culprit, but I am not sure how to rectify it, I will post the entire code here so you guys can have a look.
package
import fl.controls.Button;
import fl.controls.TextInput;
import flash.display.Sprite;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.events.NetStatusEvent;
import flash.events.MouseEvent;
import flash.events.Event;
//import flash.net.ObjectEncoding;
import flash.media.Camera;
import flash.media.Microphone;
import flash.media.Video;
public class MinRecord extends Sprite
private var nc:NetConnection;
private var ns:NetStream;
private var rtmpNow:String;
private var msg:Boolean;
private var cam:Camera;
private var mic:Microphone;
private var vid1:Video;
private var recordBtn:Button;
private var stopBtn:Button;
private var textInput:TextInput;
//Constructor
function MinRecord ()
//NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0;
nc=new NetConnection();
nc.addEventListener (NetStatusEvent.NET_STATUS,checkConnect);
rtmpNow="rtmp://192.168.0.11/vid2/recordings";
//rtmpNow="rtmp:/vid2";
nc.connect (rtmpNow);
addMedia ();
addUI ();
recordBtn.addEventListener (MouseEvent.CLICK,startRecord);
stopBtn.addEventListener (MouseEvent.CLICK,stopRecord);
private function addMedia ():void
cam=Camera.getCamera();
cam.setMode (240,180,24);
cam.setQuality (0,90);
mic=Microphone.getMicrophone();
vid1=new Video(cam.width,cam.height);
vid1.attachCamera (cam);
addChild (vid1);
vid1.x=100;
vid1.y=50;
private function addUI ():void
recordBtn=new Button();
recordBtn.label="Record";
recordBtn.x=100;
recordBtn.y=50+(cam.height) +5;
recordBtn.width=70;
addChild (recordBtn);
stopBtn=new Button();
stopBtn.label="Stop Record";
stopBtn.x=recordBtn.x+85;
stopBtn.y=recordBtn.y;
stopBtn.width=75;
addChild (stopBtn);
textInput=new TextInput();
textInput.x=recordBtn.x;
textInput.y=recordBtn.y + 30;
addChild (textInput);
private function checkConnect (e:NetStatusEvent):void
msg=(e.info.code=="NetConnection.Connect.Success");
if (msg)
ns = new NetStream(nc);
private function startRecord (e:Event):void
if (ns)
recordBtn.label="Recording";
ns.attachAudio (mic);
ns.attachCamera (cam);
ns.publish (textInput.text,"record");
private function stopRecord (e:Event):void
recordBtn.label="Record";
ns.close ();
My deduction is that the 'if' statement in the 'startRecord' function is not resolving to 'true' and hence the label is not changing to 'Recording'. Also I feel that the assingment to the variable 'ns' of type NetStream is not being done and hence in the function 'stopRecord' I get the above mentioned error message when I click on the stop button. How do I rectify these problems?Hi Amit,
Thanks for the message, I had acutually realised late last evening that changing this:
rtmpNow="rtmp://192.168.0.11/vid2/recordings"
to this:
rtmpNow="rtmp:/vid2"
which is what you have also recomended solves one of the problems which is that of the startRecord function, as my server is running on my own local machine. However when I click on stop record, I am getting the following error:
"Error #2044: Unhandled NetStatusEvent:. level=error, code=NetStream.Publish.BadName
at MinRecord/checkConnect()"
I am trying to figure this one out...if you have any clues, let me know. Thanks. -
I keep getting this annoying "hum" whenever I record and play back!
I'm using the latest iMac desktop, w/my Motif 7... connected through an EDIROL interface Model UA-1EX.
Whenever I record/playback there is this "hum" that I can't get remove, whether I select "monitor on or off!"
But I'm also using my ALTEC LANSING computer speakers w/wolfer as my monitors.
Do I need to invest in some monitors designed for computer recording applications?
Thanks,
Ronthe first thing to check/try is that all AC powered devices are plugged into the same power outlet.
-
How do I turn the metronome off while recording and playing back?
It's quite annoying ... And I am a newbie.
Use the spanner/wrench tool to set options. You can disable it altogether, use it for count ins only, or even change the tone/instrument.
tt2 -
Recording and playing back Events
Hello
I posted in AWT forum several days ago and have not received any response. This board looks to be more active. Could anyone here comment or help with what I am trying to do?
Thanks in Advance
http://forum.java.sun.com/thread.jspa?threadID=742720&tstart=0Hi
Welcome to Apple Discussions.
We don't get very many questions about Core Audio here so if you don't get any response, you can try the Apple emailing list for Core Audio:
[email protected]
The list is very friendly and I'm sure someone there will be able to answer your question.
Bob -
Hi List,
I have developed standalone applications wherby i want the
give the
user an option of recording voice and then replaying the
recorded
sound. No need to save a file. Just record and listen.
Is it possible to record and play sound in Flash swf-files
without the Flash Communication Server?
If not is there any third party component which can help me
solve this purpose?No, don't think this is possible without Flash Media
(formerly Communication) Server.
Search these forums though. The question is asked pretty
often, so maybe someone has offered a different answer.
Cheers! -
Record audio clip and play back it into media player
how can i record voice clip using java application and play back it with media player.
870902 wrote:
how can i record voice clip using java application and play back it with media player.1) Record from "javasound://0" using a Processor / DataSink
2) Play back the file from 1 using a Player -
Hello,
I am running OSX 10.4 11 server and have an internal web site I am running. It's on a G4 Xserve with 4GB of RAM. Not that many people access the internal site so I don't think it's the load, but I guess you never know.
anyhow, I created this swf file about 400k and they are very slow opening and playing back.
any clues on what it may be or what I can check?
Thanks,The way your doing it now can get really confusing over time.
save a reffrence in an object or an array that would indecate to you if it was loaded allready or not for example the full switch you have up there could of been this instead:
1. give your clips there URL so you don't need to ask for it again if your working with movielclips for your buttons or if you created a class for them just give it a public var such as 'actionURL'
so for example
btn1.actionURL = 'link1';
btn10.actionURL= 'link10';
now that everything knows what it loads all is left is for you to now follow after things
1. when the buton is clicked you can ask itself what is the url e.target.actionURL
2. you can then have a flag (boolean value such as isInTransition) that lets you know if there is an animation going on
2.1 there is no animation so lets load it up
2.2. ther is an animation so lets save the data and wait for the animation to complete before we start the load
and thats about it
if you want to save a reffrence to if the clip was loaded or not you can save your result in many ways one of them could be an object/array that holds everything that was loaded already
var oLoaded:Object= {};
onLoadNewItem(e:Event):void{
if(!oLoaded[e.target.actionURL]){ i was never loaded before
oLoaded[e.target.actionURL] = new Loader(....
}else{
oLoaded[e.target.actionURL] //here is my loader do with it what ever you want to do
hope this hit the nail on the head -
Recording and playing audio files
hi, is there a way by which one can record and play an audio file in java ?? I am doing a project in Voip but I can't find any help in this matter(actually i am a newbie in java ) .. can anyone please tell me how to proceed?
Edited by: streetfi8er on Jun 28, 2009 2:47 AM>
hi, is there a way by which one can record and play an audio file in java ?? I am doing a project in Voip but I can't find any help in this matter(actually i am a newbie in java ) .. can anyone please tell me how to proceed?>You could not find anything on ['java audio'|http://lmgtfy.com/?q=java+audio]? Where did you look, underneath the bed and in the back yard?
Note that you might help dispel my impression that you are lazy, by applying the shift key once at the start of each sentence. -
Cannot hear input when recording or playing back a track
Frustrating problem which I am sure is simple to fix -
When not recording or playing back a recorded track in Adobe 3.0, I can hear my keyboard fine through my soundcard line in. However, when I record a track, I cannot hear it any more (though it is being recorded, and I can hear it on playback of the recorded track).
Also, when playing back a recorded track, I cannot hear my keyboard input again. Only when I stop the playback can I hear it.
Obviously I need to hear what I am playing as I am recording, and also want to play along to recorded tracks.
And when I enable "monitor input level" then the level bar indicates sound, but again I hear nothing.
My setup: Korg Triton Studio connecting via Line in to Creative Soundblaster X-Fi soundcard on Windows Vista PC.
Many thanks in advance !!
DanThanks for reply - when I do as above, then I can hear the track I am playing as I am recording it. I still cannot hear it however when I am just playing along to a pre-recorded track.
Also, with smart input, there is a small delay between pressing the key and hearing the sound which I do not like.
Any ideas? -
I am making a microphone, is it possible to record and play at same time in swift, is there a option to record without storing the file
Its pretty simple with FMS. You just need to do following things:
Publish using FMLE with following settings: (just telling which are needed , rest you configure based on your needs)
Video codec: H.264
Audio Codec: <of your choice>
Server ip: rtmp://<server-uri>/<app-name>
Stream Name: mp4:<stream-name>.f4v
Application : Server-side code
application.onPublish = function(myclient,mystream){
mystream.record();
application.onUnpublish = function(myclient,mystream){
mystream.record(false);
Have a client , which subscribes in following live mode:-
ns.play("mp4:<stream-name>.f4v",-1,0,true); // this is subscribing in live mode
In this way even if file is recorded, your clients are subscribing in live mode so all will be in sync.
Now if you want to disallow any clients who will try to subscribe to "recorded" file when live event is going on, you can achieve using auth adaptor. (let me know if you want to enforce such requirement)
But i think above solution solves your primary problem. Also please let me know if there are any issues in getting it work , i have given bare minimum which is required. -
Recording and playing sound input from mic simultaneously in iphone/ipad
I want to simultaneously record and play the sound from a mic in iphone. As thecricket commentory application.
Please provide me a solution for this.
Is this possible in iOs.This probably isn't going to sound very helpful, for which I apologise in advance, but I'm afraid it's the truth...
The only way you stand any way of doing any of this is by using ASIO4ALL, which can aggregate different drivers from multiple devices. But I don't rate your chances too highly, I'm afraid - USB mics have long been the problem child of computer-based audio. On top of that, you are trying to get sounds in and out of a separate device at the same time - not only that, but it's a Creative Labs gamer's device and they are second only to USB mics in terms of the 'difficult' stakes - search this forum!
A much, much better way to attempt to do this would be to use a sensible ASIO external device with sufficient inputs, and a mic that plugs into it, not a USB one. That way you could route the inputs and outputs appropriately, and use the device's monitoring so that you could monitor what you need to. I wouldn't attempt to do anything like this any other way, I'm afraid. Another approach (which can be made to work well) is to use an external mixer to do most of the work - often it's easier to set up the monitoring on these. You can get mixers with the appropriate interface built-in, and they don't cost a fortune either. Mackie and Behringer make suitable devices. -
Please help me with recording and playing audio simultaneously!!!
Right now I can either play the incoming stream OR record it. I tried making Clones for datasource like :
DataSource clone1 = Manager.createCloneableDataSource(originalSource);
Then I pass it to these 2 classes:
new playThread(clone1).run;
new recordThread(clone1).run;
playThread is a Thread class that will take the cloned datasource and then plays it while recordThread will record the incoming datasource. Here is what happens when i run them one after another:
When I run playThread before recordThread I get ACM driver error. But if I run the recordThread before playThread the playThread's playerWindow shows up and plays for a split second then stops; The recordThread does record all the incoming stream though... Here are my questions....
1. Anyone know what my problem is? is it resource alocation? Threading problem?
2. Did I use the clone datasource correctly? I tried making clone1, clone2 but those didnt work well either...Should I do anything to the clones for record and play? all I did was pass them to the 2 classes and those classes just use them straight out without proccessing or anything...
Please help me out!!!! thanks a bunch!i dont think it is... i tried the clone thing but samething happened... it might be a Thread problem since when i put those together sometimes record runs sometimes player runs... and at the end i get "ERROR while querying ACM driver's information" error..... i am really confused...
DataSource clone1 = Manager.createCloneableDataSource(originalSource);
DataSource clone2 = Manager.createCloneableDataSource(clone1);
playerThread play= new playerThread(clone1);
recordThread record= new recordThread(clone2);
record.start();
broad.start();
anyone can help is appreciated
Maybe you are looking for
-
Problame connecting iphone to pc and charging
hello, I have been having a hard time connecting my iphone to the pc or the wall ac plug. when I plug it in, some of the time the icon changes and the device charges normaly, some of the times i get a worning that the iphone cannot be charged when "t
-
Can't start imported VirtualBox appliance on Arch host with errors
(I have been referred here from this thread in the VirtualBox forums because it is suspected that the problem is Arch-specific) I've installed latest VirtualBox 4.0.4 via pacman in a fully updated Arch Linux system. Then, I successfully imported the
-
1:N mapping without using BPM -- IDOC to multiple files
Hi all, I am facing a problem while sending multiple files, I need to send files ( File1, File2 or FIle3) ... I was able to successfully send the first 2 files and along with it the 3rd file is being created without any data... How to stop this file(
-
I had to delete everything on my computer and install the operating system again , but I had to install Snow Leopard because it was the cd that came with the computer when I bought it. The problem is that I had already paid for the OS Lion and even h
-
Premiere Pro CC project won't open.
The last back up was 6 days ago. The error message says 'an unknown error occurred while opening the project'. So I looked on here but the best advice was to try to import the project into a new project. I tried this but it didn't work. I then clicke