ActionScript 3.0 :: Creating Public API For Player?
Aug 18, 2010
Is there any best practices one should follow when creating a public API for an existing application?
My my case it's a video player. We've built it to be *very* generalized and flexible so that it can be used by us, but also be licensed to third-parties.
I'm working on a new feature now where content on the page (relating to the current video) gets refreshed via a jQuery AJAX call when a new video in the playlist is cued, so I'll be having the player make an ExternalInterface call to a javascript function in the page in order to let it know when and what to update.
The problem is, how do I generalize such a thing? There are many cases where we *won't* need this functionality, and our clients will likely never need such a thing, either.
var environment:AvEnvironment = new AvEnvironment(...); addChild(environment); environment.addChild(new Terrain()); environment.addChild(new Player());
I am trying to access a public property from AvEniroments class through the Player class, however I'm getting an undefined property error (#119). I've tried the following:
this.x = AvEnvironment.xs // public property in this class this.x = parent.xs
I've also tried something like this:
var ev:AvEnvironment = AvEnvironment(parent); this.x = ev.xs
but I get a TypeError. Error #1009: Cannot access a property or method of a null object reference.
Im trying to create one similar, but isn't all the way fancy, it just plays the music, I just want it to have a playlist, volume, stop, next track, previous track, and a picture for each song.
i dont really have a clue how do this. So far i created a 1600x1000 skin completely similar to the link above, now i just need to know the right coding for the buttons, and how can keep adding music every 2 weeks. and tommorow (which is in a couple hours), i will have a chance to work with cs4 in a studio.
I've been trying to find useful information on the web about using components in flash. I want to create a simple mp3 player, and I wanted to use the components because I thought that would be easier. I want to create something like this: [URL].
i really need something to begin a Video Player development. Can you show me any arcticle or tutorial explaining how I should proceed? As a matter of fact I simply need a manner to change the source file whenever o click on a different button.
Ive built a pretty nice video payer for swf movie files.So be fore I go any further with it I wanted to extend it to run flv files too. So far this has been a major pain.Im thinking ill buy one of the flash 8 action script books.Everything ive read so far tells me to use the flv components? But I dont want to! I want to adapt my action script from my already working swf player to an flv player?Does anyone have any good tutorials or tips to creating an flv player without components? ive managed to load play and pause an flv and also controll the audio but i want a video progress bar and rewind and fast forward button...
How we can create a basic Flash & ActionScript based mp3 player with a playlist that displays songs and allows you to choose from it? I know how to make the basic player with the play, stop, next and previous buttons but wanted to create one with a playlist.
I'm creating an mp3 player with playlist, equalizer etc. I've worked with an equalizer before, however I want this equalizer to display outside of the playlist movie clip where all the track information is stored.
I'm trying to create a flv custom player with scrollable playlist, much like youtube's. Anyways, I have a scroll bar with the buttons inside of it. The problem is the buttons that are inside the scroll bar do not want to communicate with the main timeline. So I want to press the button inside the scroll bar and have the selected video play on the main time line. So if the buttons are three movie clips deep into the timeline how do I tell it to play video1 on the main timeline when that button is clicked?
I have created an application which includes a menu system for selecting videos and a video player. Currently when the application opens the flv player video starts on load. I would like to change this to show a preview image which would not disappear until my users click on a button to view a video.I have tried to use the preview image function in the flv player and received this error:"The preview image is displayed at authoring time only. To generate a runtime preview image, use the export button and load the image back by writing your own ActionScript.
Which product do I need in order to create a customized flash player (and that is all I need to do)? I have a VP6 Alpha Channel.flv movie (transparent background). I would like to create a custom flash player for my website to display and control this movie.The player needs the following properties:
1. Play the movie transparently (using "wmode"?) 2. Play, pause, volume and exit buttons on the control bar 3. Autohide control bar 4. Logo / text on the control bar 5. Ability to unload itself after the movie ends
Which is the right product for me? Any links on how to create this player would be useful.
I'm trying to create a persistent MP3 player using SharedObject. Initially I tried using frames and while it worked, frames suck so I continued looking into it. I came to find out about Flash's SharedObject. It seems easy enough but I can't nail down the logic correctly. I've attached a sample .fla for anyone interested to look at. I need the song progress to be stored and retrieved when necessary to keep the same song playing whenever links are clicked within the HTML page. Here's a link to the .FLA - [URL]
What im trying to do: well basically I want to create an audio player in flash. I would like for it to have buttons for next and previous track, pause, stop, play, and display song info.Basically the one here at the bottom of the page:[URL]So what I got down at this point:
-Creating stop and play buttons that load/unload external swf files that contain the song.-Show track info.-Creating next/previous track buttons so I can rotate between more than one song.-Pause button.
So Im developping a video player that I can reuse in my projects.
The video player contains both .as files and graphical assets (buttons, loading bar, etc). And the graphical assets need to be styled for each project.
Right now the approach Im thinking of is having a base videoplayer.fla, and importing the library items into my new fla, and modifying the graphical assets manually there.
The other option Im thinking of is compiling a swc, but afaik the styling would become more complicated and more limited to colors, fonts, and such.
I'm creating something like a video player with annotation functionality. I can load up the notes, with times at which they were made by people (as strings), and put these into an array to be utilized. I also know the current time of the flv video as it's playing. So each note has a time attached to it, but how can I use these as triggers that fire dynamically in relation to the video's duration?
I have a client who wants multiple players on a page, each playing a different video. The tricky part is that they want to be able to add videos to their website with this custom player on their own, without having to go into the flash file.
Anyone have an idea or where I can find out how to do this? I dont' think XML would work, because it would still have to call a specific node inside flash...and this one swf should be able to work with any .flv they want.
I need to create a dynamic movie player in the flash website, i tried Import Video... (File > Import >) , then i put a relative URL of xml file (e.g. xspf.xml) under the "Already deployed on web server..." option. but the video doesn't show nothing at all.
This is my code in xspf.xml:
[Code]....
is there any other better or easier way to create an flv player within flash website which support multiple video file as a playlist?
i am trying to create a swf file where you can arange clips ( containing vidieointo a certain order then when you hit play button it plays all the individual palced files one by one after each other
I am creating a video player that sets up a preview image before it begins to play. If I set the preview image in a loader within a container it works, except if I change the size of the preview.jpeg that is being loaded into it. It loads the image into the loader, within the container, but then scales the container making the image smaller than I need. I want it so that the preview.jpeg can be made by anyone at any size and the image be scaled to sit over the video. Unless the vidWidth and vidHeight are equal to the preview.jpg the image doesnt show up, just blank ??
Code: var vidWidth:Number = 300; var vidHeight:Number = 240; var preview_Loader:Loader = new Loader(); var preview_URL:String = "preview.jpeg"; var preview_Request:URLRequest = new URLRequest(preview_URL); [Code] .....
returns: ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. This only happens when I try to set the index of the preview_Loader? I need it to be the second mc from the bottom. I set up 2 functions to load the image. The first doesn't allow smaller images to be loaded into the container and make them the correct size. While the second makes them dissapear if I change the size.
I'm creating a mute button for an audio player that I pieced together, and it seems to be working alright except when I advance to a new track. If the volume is NOT muted and I click a new track it's fine, but if the volume is muted (i.e. at "0") and click a new track it remains at 0 and won't un-mute when I click the button.. though if I click the button to un-mute it and then select a new track it's fine, so I think there's something in my playSong() function that's interfering, I just can't tell what it is.
I've just been asked to create a video player which automatically chooses the correct bitrate video to stream by detecting the bandwidth.I have no experience creating a video player so I'm looking for links/resources to do some research on the topic.Has anyone here created a video player in Flash? Would it be better to create in Flash or Flex?Once again, I have no prior knowledge in this type of creation and could use an experienced developer's opinion on what the first step is towards progress.
I have created some code in Actionscript 3 following various tutorials which is a simple media player linked to an XML file for the source information.I have found out though I need to use actionscript classes for the code and wondered is their a way to convert it to classes or does anyone know of a tutorial in actionscript 3 for creating a media player based on classes? My code is below: