How Do I Control The Media Display Component With Code?
I am streaming in an Mp3, I want to create buttons that tell the media display component to stop, play, etc.
How can I do this?
FlashKit > Flash Help > Flash ActionScript
Posted on: 03-26-2005, 10:28 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Media Display Component
I cannot get the cue point to show/stop at Nested Screens, only at proper Screens.
Perhaps it is not supported?
I am following an article on the Macromedia site. I think the link is http://www.macromedia.com/devnet/mx/...omponents.html
(I cannot access the site today, which happens quite often nowadays)
Media Display Component
If you use a media display component can you change the contentPath like you can with the Flv Playback Component?
I want to play some random MP3 files on my site and this is the only way I can think of doing it.
Media Display Component And Bad Oop Design
hi.
i've got an .fla that exports fine from the flash ide, but in an html page i get plenty of errors (inconsistently). sometimes it plays in IE, sometimes Firefox, sometimes neither, etc...
i never thought that the code that is in my .fla could affect my browser displaying it, but it definitely seems to be the case.
the situation is that i have an .fla with a media display component. the component links to an external .flv.
i am calling an onEnterFrame event on the component itself, ie:
videoController.onEnterFrame = function()
{
// execute these statements
};
is that a bad idea? i just need to do a few things like define some variables, display the timecode in some textfields, and have the progress bars follow the video.
these are the statements i'm triggering inside this function:
define the variables
playLength = 48; // total length of video, hardcoded
currentTime = Math.floor(videoController.playheadTime);
display current time and total time in text fields
var timeCode = convertTime( currentTime );
var timeTotal = convertTime( playLength );
totalTime_txt.text = "/ " + timeTotal;
controlTime_txt.text = timeCode;
this is the number that the progress bar will follow -- video progress essentially
var pos:Number = Math.floor( 112 / ( playLength / currentTime ) );
if user clicks to go to end, extend progress bars and change time display
if (seekEnd == true)
{
pos = 112;
controlTime_txt.text = timeTotal;
}
have progress bars follow these positions
pIBar_mc.targetScale = pos;
pIHead_mc._x = pIBar_mc._x + pIBar_mc._width;
and that's it. am i missing something here? is there a better way to do this?
thanks. matt.
MX 2004 Pro. Media Display Component
I have a video playing in a media display component. At the end of the video I want it to jump to a new scene or a movie clip that fades and reveals the site's home page. In the page, I'm calling an accordion component.
Here is my problem:
I tried using a slide-show to go from the video to the page which worked fine. Unfortunately, my accordion was non-existant in the page.
Now I'm trying to get the video to load the next scene or even a movie-clip with the site in it. But this is causing me a major headache.
Does anyone have any idea how I might accomplish this? Or maybe a link to a tutorial that could help?
Thanks,
Flash MX Pro Media Display Component
I have a video playing in a media display component. At the end of the video I want it to jump to a new scene or a movie clip that fades and reveals the site's home page. In the page, I'm calling an accordion component.
Here is my problem:
I tried using a slide-show to go from the video to the page which worked fine. Unfortunately, my accordion was non-existant in the page.
Now I'm trying to get the video to load the next scene or even a movie-clip with the site in it. But this is causing me a major headache.
Does anyone have any idea how I might accomplish this? Or maybe a link to a tutorial that could help?
Thanks,
Detecting The End Of FLV With Media Display Component
hello all, i posted this already on the video forum, no luck so far...
i'm using a media display component
and for now i'm giving it a few frames to run as an intro. of course the number of frames is only a rough calculation...
how do i detect the end of the video properly?
anyone?
Problem With Media Display Component
Hi,
I'm using action script 7. I wonder if anyone can tell me where I'm messing up.
I have a media display component that pulls a .swf file from a path on my server. For some reason, the loaded media shows outside the display box (top and bottom) as if it isn't masked properly.
Anything??
Thanks for reading.
Media Display Component And Bad Oop Design
hi.
i've got an .fla that exports fine from the flash ide, but in an html page i get plenty of errors (inconsistently). sometimes it plays in IE, sometimes Firefox, sometimes neither, etc...
i never thought that the code that is in my .fla could affect my browser displaying it, but it definitely seems to be the case.
the situation is that i have an .fla with a media display component. the component links to an external .flv.
i am calling an onEnterFrame event on the component itself, ie:
videoController.onEnterFrame = function()
{
// execute these statements
};
is that a bad idea? i just need to do a few things like define some variables, display the timecode in some textfields, and have the progress bars follow the video.
these are the statements i'm triggering inside this function:
define the variables
playLength = 48; // total length of video, hardcoded
currentTime = Math.floor(videoController.playheadTime);
display current time and total time in text fields
var timeCode = convertTime( currentTime );
var timeTotal = convertTime( playLength );
totalTime_txt.text = "/ " + timeTotal;
controlTime_txt.text = timeCode;
this is the number that the progress bar will follow -- video progress essentially
var pos:Number = Math.floor( 112 / ( playLength / currentTime ) );
if user clicks to go to end, extend progress bars and change time display
if (seekEnd == true)
{
pos = 112;
controlTime_txt.text = timeTotal;
}
have progress bars follow these positions
pIBar_mc.targetScale = pos;
pIHead_mc._x = pIBar_mc._x + pIBar_mc._width;
and that's it. am i missing something here? is there a better way to do this?
thanks. matt.
Media Display Component And Bad Oop Design
hi.
i've got an .fla that exports fine from the flash ide, but in an html page i get plenty of errors (inconsistently). sometimes it plays in IE, sometimes Firefox, sometimes neither, etc...
i never thought that the code that is in my .fla could affect my browser displaying it, but it definitely seems to be the case.
the situation is that i have an .fla with a media display component. the component links to an external .flv.
i am calling an onEnterFrame event on the component itself, ie:
videoController.onEnterFrame = function()
{
// execute these statements
};
is that a bad idea? i just need to do a few things like define some variables, display the timecode in some textfields, and have the progress bars follow the video.
these are the statements i'm triggering inside this function:
define the variables
playLength = 48; // total length of video, hardcoded
currentTime = Math.floor(videoController.playheadTime);
display current time and total time in text fields
var timeCode = convertTime( currentTime );
var timeTotal = convertTime( playLength );
totalTime_txt.text = "/ " + timeTotal;
controlTime_txt.text = timeCode;
this is the number that the progress bar will follow -- video progress essentially
var pos:Number = Math.floor( 112 / ( playLength / currentTime ) );
if user clicks to go to end, extend progress bars and change time display
if (seekEnd == true)
{
pos = 112;
controlTime_txt.text = timeTotal;
}
have progress bars follow these positions
pIBar_mc.targetScale = pos;
pIHead_mc._x = pIBar_mc._x + pIBar_mc._width;
and that's it. am i missing something here? is there a better way to do this?
thanks. matt.
How To Dynamically Load Mp3's With The Media Display Component.
Alright. So, using the Media Playback component, I am creating an online mp3 player to be used with perl-created databases. Perl part is covered. My problem occurs when I try to reference the mp3 files with a variable. The content the Media Playback component has to be referenced to a variable that is created based on parts of the perl database. Everything I try either yields an Undefined, or it just trys to find the file named "_root.1ID" witch of course is the name of the variable I am trying to extract from.
I Wanna Scream.. Media Display Component
I have the Media component display which I set to pull a FLV video in. My problem is, I have to buttons and play and stop. I assing this to play
display.addEventListener("play", );
butt I get an error even when i put in an event handler
on (release) {
display.addEventListener("play", );
}
Help guys.
Same deal with the stop button as well
How To Dynamically Load Mp3's With The Media Display Component.
Alright. So, using the Media Playback component, I am creating an online mp3 player to be used with perl-created databases. Perl part is covered. My problem occurs when I try to reference the mp3 files with a variable. The content the Media Playback component has to be referenced to a variable that is created based on parts of the perl database. Everything I try either yields an Undefined, or it just trys to find the file named "_root.1ID" witch of course is the name of the variable I am trying to extract from.
Do You Have To Have The Latest Flash Player In Order For The Media Display Component
Do you have to have the latest Flash Player in order for the Media Display Component to work when browsing? I have a site up and I can see the video fine , but a couple of peopl ewho have looked at it cannot see the video only a gray box. What could cause this I am trying to pin point the problem if you coul dhelp I woul dgreatly appreciate it check the link below I used the Media Display in the bottom right hand corner of the screen.
http://www.kaewun.com/k1.html
let me know if you saw it and what version of Flash Player u have and Browser.
Mute/unmute Button For Streaming Audio Using Mp3s In 'media Display' Component
I am currently streaming an mp3 onto my site through the media display component which is invisible. This is great apart from I cannot seem to make a mute/unmute button to control it. I've tried the other streaming component(media playback) but I don't want anything that big or need all the control that it offers. Really I just want a mute/unmute button or possible a volume slider. I have tried this method...
(first frame)
my_mainsound = new Sound(this);
my_mainsound.setVolume(100);
(on a button)
on (release) {
if (SoundIsMute) {
my_mainSound.setVolume(100);
SoundIsMute = 0;
} else {
my_mainSound.setVolume(0);
SoundIsMute = 1;
}
}
....but I think this only works for sounds inside the swf as opposed to streaming sounds.
Any help ideas much appreciated.
m
Syncing Mp3 With Media Display
I am attempting to create a training module using the new slide based presentation in MX 2004 Professional. I've used the Flash Article [L=Building a Streaming Video Presentation with Macromedia Flash MX Professional 2004 Media Components]http://www.macromedia.com/devnet/mx/flash/articles/media_components_print.html[/L] as a reference, and can get my mp3's to sync with slides when they are all in the same level of the slide heirarchy. However, I need to have some of the screens nested in order to have titles and some pictures overlaying between slides. As soon as I nest any of the slides, the media player component no longer syncs correctly. Any suggestions? Or is this something I just can't get flash to do. There's not a lot of info out on MX 2004 Pro yet...grr...
Media Display Problems
Hi,
Im using in my movie The media display component.
In my movie im using 2 scene
My first scene its a preloader, and when it finishes loading it goes to the next scene by nextScene();
My problem is that when the media display is in the movie im getting a blank scene and when i remove it, it display correctlly.
very strange !!! and ideas ?
Media Display Cue Point
hello,
i'm trying to use a media display component that displays a video.
after 10 seconds into the movie i'd like the main timeline to jump to a certain label.
tried to do it using a cue point but the help notes only gets me so far...
could someone walk through it?
How Do You Loop Flv In Media Display?
I'm calling an flv into a mediadisplay by
ActionScript Code:
video.setMedia("video.flv","FLV");
I have two questions:
How do you loop the video.flv file after it completes?
How do I include this into my preloader AS where it doesn't execute the play next frame command until after the flv starts to stream?
Preloader AS
ActionScript Code:
onEnterFrame = function () {
based on total bytes
loading = _root.getBytesLoaded();
total = _root.getBytesTotal();
percentage = Math.round((loading / total) * 100);
//display percentage
if (isNaN(percentage)) {
percentage = 0;
}
//Display percentage value in text field
percentage_mc1.percentage.text = percentage_mc2.percentage.text = percentage;
//Jump to frame number in this movieclip based on percentage loaded
this.gotoAndStop(percentage / 10);
//Check when _root has loaded completly, then trigger preloader fade out and end onEnterFrame loop
if (percentage == 100 && total > 0) {
//fade out preloader when loaded
if (this._alpha > 0) {
this._alpha += (-this._alpha) / 4;
} else {
_parent.play();
delete this.onEnterFrame;
}
}
};
stop();
Media Display Problems
I am having a problem with the Media Display component.
Basically what it needs to do is play an flv full screen. The media display is in a movieClip. What I need it to do is this:
when the container movie clip is shown. Create the mediaDisplay (createClassObject). and play the flv. and keep looping the flv.
when the container movie clip is hidden. destroy that mediaDisplay (it needs to be completely gone, out of memery, out of flash.. so it frees up the cpu resources).
when that container movie clip is show again. it needs to create the mediaDisplay and play it / loop it again.. until the container is hidden. basically its a big loop of those two pieces of functionality.
The problem is this: when you hide / destroy the movie clip. resorces don't get freed up for the cpu. (watch the task manager's cpu activity)... i've got a big application that this problem is killing.
hope you can help me
Loop Media Display
I have a video playing through media display but it isnt that long so I want it to loop, how would I do this with just the media display. I dont want the user to have control.
thanks,
How To...unload Media Display?
I loaded an flv into a media display component, but when the flv finishes, I don't know how to unload it or the component.
Pausing Media Display In Loader - Help
Hello all - I have a stumper and it's just killing me.
Created a movie with a loader component, and all swfs load in and play fine - each swf is playing an flv or mp3, I've created a button in the _root movie and want to pause the flv or mp3 that is playing in the loader. Can't make it work and I'm hoping that someone can help. I've tried:
on(release) {
myMedia.pause(myLoader);
}
and
on(release) {
myMedia.pause(_root.myLoader);
}
and
on(release) {
myMedia.pause();
}
What am I missing/HELP - please
Thanx.
Can You Loop An External Mp3 Using Media Display
I am loading external mp3s from URLs and I added the Media Display component to play them. Is there something in the MediaDisplay that will let you loop them? Right now they just play once and stop.
Here is how I am playing my mp3s:
controller.autoPlay = false;
controller.setMedia(artistSong,"MP3");
play_mc.onRelease=function() {
controller.play();
}
stop_mc.onRelease=function() {
controller.stop();
Detect Timecode From Media Display
I've got a training FLA I'm authoring and it contains a Media Display and Controller component. The Display component uses a list of cue points to navigate through my label-rich presentation mc, but I'm also in need to add a caption mc that can detect the timecode of a playing media display component and sync its own mc timeline along with the narration. I figure there has to be some why to listen to the media display or the controller component and then use that to move the playhead on the caption_mc timeline.
Any suggestions or am I being a bit too optimistic?
Change The Video On The Media Display
on flash 8 pro, IŽm using the media display to play a FLV from the web, butiŽd like to be able to create buttons to change the video played. What AS Sould I use on that button?
thanks
Detect Timecode From Media Display
I've got a training FLA I'm authoring and it contains a Media Display and Controller component. The Display component uses a list of cue points to navigate through my label-rich presentation mc, but I'm also in need to add a caption mc that can detect the timecode of a playing media display component and sync its own mc timeline along with the narration. I figure there has to be some why to listen to the media display or the controller component and then use that to move the playhead on the caption_mc timeline.
Any suggestions or am I being a bit too optimistic?
Scale Media Display Not Mediacontroller
Hi,
I've built a basic video player that contains the media display component and the mediacontroller component. What I'm attempting to do ...or at least what I want it to do is:
When you resize the window, allow the display to scale/centered. but keep the controller that same size/centered.
Here's what is not working:
Code:
Stage.scaleMode = "noscale";
Stage.align = "T";
var myListener:Object = new Object();
myListener.onResize = function () {
vid_display.setScale(100, 100);
}
Stage.addListener(myListener);
Thanks in advance for any help.
Dallas
MX2004 Media Display Components And Flv Video
Im using multiple instances of the media display component loaded into a level 1 swf which are loaded as required and contain flv video. A couple of problems, firstly if the swf containing the flv video is unloaded before the video has finished playing the audio continues to stream and play to the end.
The second issue, being that the video will only play back once, if I reload the swf containing the video i am faced with a blank screen. im guessing that the components or the net stream need to be reset or initialised after each use but im not sure how.. Any help appreciated..
Preloader/Media Display Help Flash MX 2004
I'm putting some video of my artwork up on display on a website I'm designing for myself (using the flash/dreamweaver combo). I've decided to showcase my work by creating (which I think is pretty common) thumbnails with a media display beside them. I have my video controls and everything working -- it's all very rough and clunky (I wish I really knew what I was doing and could take the rough edge off -- jazz it up a bit -- suggestions would be great) but anyway when I put it on the website, naturally it takes between five and 10 seconds to load the .flv into the media display (with a simple fade command). I've tried numerous times to utilize a simple preloader -- didn't work, then I downloaded a few other preloaders but could not get any of them to work either. I'm also working with slides I believe they're called -- could be that because I'm still experimenting as a newbie that I'm going about this media display thing the wrong way (maybe I shouldn't be working with slides?? but I would have no idea how else to do it and I've probably put a good 30 hours into this already - yeah, I know an experienced flash user could probalby do this with his eyes closed and his hands tied behind his back). In any case, perhaps someone with more knowledge in this area could assist me here... Attached is the .fla file. I did not attach the .flv as I figured it's probably not necessary. Thanks much! Oh, here's a link to the file just in case it didn't upload correctly -
http://www.onlinefilefolder.com/inde...758b2d53d70388
Jason
Help Needed ASAP With Media Display And Next Frame...
I have a MediaDisplay Component on the stage with a .flv file externally linked. Basically I need the playhead to go to frame 2 after the video has finished.
All I can find are examples using the forms and the Component Inspector to go to another page in the form.
Can't I just go to frame two????
Thank You..
Help Needed ASAP With Media Display And Next Frame...
I have a MediaDisplay Component on the stage with a .flv file externally linked. Basically I need the playhead to go to frame 2 after the video has finished.
All I can find are examples using the forms and the Component Inspector to go to another page in the form.
Can't I just go to frame two????
Thank You..
Media Control / Playback Problems... Does Anyone Know How?
Hi,
I'm using the media control and media display to stream external mp3's.
When a user clicks an audio link, I want it to start loading the relevant mp3 but not start playing it until the play button is pressed.
At the moment this is my code. It works ok but sometimes produces strange results such as the playhead moving along with the streaming line!
_root.mdisplay.setMedia("mymp3file.mp3", "MP3");
mp.stop();
mdisplay.stop();
mp.setPlaying(false)
mdisplay.setPlaying(false)
Basically when a new mp3 link is clicked on, I want the playhead to move back to the beginning, the mp3 to be in pause state (but still loading), and the play button to display the play triangle.
Any help would be appreciated
Thank you,
Rik
Media Control / Playback Actionscript... Does Anyone Know How?
Hi,
I'm using the media control and media display to stream external mp3's.
When the user clicks an audio link I want it to start loading the relevant mp3 but not start playing it until the play button is pressed.
At the moment this is my code. It works ok but sometimes produces strange results such as the playhead moving along with the streaming line!
_root.mdisplay.setMedia("mymp3file.mp3", "MP3");
mp.stop();
mdisplay.stop();
mp.setPlaying(false)
mdisplay.setPlaying(false)
Basically when a new mp3 link is clicked on, I want the playhead to move back to the beginning, the mp3 to be in pause state (but still loading), and the play button to display the play triangle.
Any help would be appreciated
Thank you,
Rik
Media Control Only Works In Fire Fox
I am very new/bad with flash and followed a tutorial online to make a video player but the player only seems to be working in firefox I dont think that internet explorer is passing the variables to it. I used the variable file to point o the flv. Could someone please take a look and help me out
http://www.searchmelake.com/webtv/hometown/hodgepodge
Events From Media Center Remote Control
is some one know how to make flash response to event from media center remote control? is a key events? mouse events or shuld a third party software like swf studio that has a joystick events?
HELP With Media Component
Hi all, I really appreciate everyone who will try to help me with this.
I have a video loading in a MediaPlayback component. Now, on the website I have a logo with the size of the mediaplayback player with the video inside. People can click on the picture (frame 1) and it will take them to (frame 2) where the component plays the video. Now here is the problem. *** When the video played in the component is over I would like to go back to frame 1 with the picture. I could not figure out a way to do it since it is not just an inserted video but flash component. If anyone knows how to make the component return the flash clip to frame 1 after the video in the component is over from frame 2 I would really appreciate it.
Thanks,
~ a30n
Media Component
Does anyone know how to make the media component play more than one mp3?
MEDIA COMPONENT
Howdey
Looking for some info on FLV video formatting.
Basically I am trying to display a quick movieclip using the mediaDisplay component. it does not want to show avi, quicktime etc.
It looks like it will only display FLV's.
Does anybody know what software can output a FLV. Had a brief play in flash but does not look like i can import an avi and export it as a FLV.
Cheers
Media Player Type Status Bar/slide Control
I have a project where I need to mimic the functionality of the status bar/slide bar control you find in various media player apps such as windows media player. To be clear, the control I'm talking about is the one that moves horizontally as the media progresses, acting as a status bar, but can also be dragged forward or backward to quickly get to a corresponding spot in the presentation.
Any guidance would be appreciated. Tutorials, code, whatever. I'm not even sure what terminology to use in a search to see if this has been covered before.
Control Window Media Volume From Flash Slider
Hello.
I have a basic flash volume slider with this generic code:
onClipEvent (load) {
top = _y;
bottom = _y;
left = _x;
right = _x+100;
_x += 100;
}
I need to make the slider contorl my windows media player volume document.MediaPlayer.Volume() and nothing I do seems to work, I'm novice at this so I'm only slightly surprised I haven't figured it out. Thanks in advanced.
B
Need Media Player Component
Is there a site where I can download a media player that i can customize for Flash MX? I know Flash 2004 has a couple of media player components built-in already but they wont work with the previous version, or will it?
Any suggestions would be greatly appreciated.
Media Component Question
Hi all,
I'm working on a project which uses the LocalConnection object to control multiple flash pieces across a page. Specifically there can be an mp3 player (for the website), a single track player (for an audio page), and there can possibly be a media player component for showing video(depending on which page the user is viewing).
Everything is working so far, so good. One problemo that I am facing, however, is that if I hit play on any of the mp3 players and a video is playing, it will pause the video player. That is what I want. The issue is that I don't know how to make the button in the mediaControl component switch back to the play button. As it stands right now it will stay as a pause button. Meaning that I have to hit it twice to get video playing again. This is not what I want.
Does anyone know the proper method or property I need to use to switch the media components button back to the "play" state? I have tried
Code:
Media.activePlayControl
but that seems to only work as an "on load" type functionality. In fact I use it successfully in this regard. There just doesn't seem to be a method to actionscript that button back into a "play" state.
Thanks in advance for any assistance you can offer me.
Media Playback Component
i would like to know if there is a way to playback mp3 's in order using the media playback component .
basically set up the component and let it run playing back mp3 after mp3 .. ?
cheers..
ps. at the moment it sems i can name only 1 mp3 to play .
in the component wizard i set it to song.mp3 and it streams but i want to add ...lets say 100 mp3's -
Component:Media Controller
I am trying to get a Component (Media Controller) to take control of my movie. For example, if you pressed play, it would play and it would show the progress bar. Same with pause, sound and everything. However, it won't work. What do I have to do to program it?
MP3 And Media Playback Component
hello all,
tough question with little time to answer...
i'm using a media playback component that calls on a MP3 track.
we can't find out a certain way to save the MP3 so it would work.
sometimes it does and sometimes it does'nt.
any ideas?
(the component calls the MP3 but plays it twice as fast)
i'm also posting this on 2 forums, since i'm pressed in time.... sorry.
|