ActionScript 3.0 :: MP3 Player - Updating Model Class
Mar 28, 2009
like a lot of people on this forum i am having trouble with an MP3 Player. I have my music player, playing, stopping and going to next and previous. But i am now trying to display the time of how long its been playing for. I have a model class (containing the soundchannel, sound and timer) which has a songsModel class (an extension of model, which contains and update method)
I also have a controller class, which is in control of the people pushing the buttons from the songController class. The controller class plays the soundchannel and starts a timer. i have a songsController class which uses the constructor of the model class as a superclass. This class is controlling users pushing buttons. My other class is a view class, which waits for the model to update itself so that it can display the latest songs.
My problem is i cannot figure out how to pass through the timer to the view class for its latest update (every half second). I have managed to display it ever time the model updates as discussed above.
[Code].....
View 1 Replies
Similar Posts:
Jan 15, 2010
I'm updating the x and y properties of my Model.as when I drag a Sprite around the stage. However, because both setter functions dispatch an Event.CHANGE, the property that is updated second seems to get locked in place (meaning it doesn't seem to be updated with the correct value as it locks the Sprite in a horizontal or vertical line of movement).
snippet from BubbleController.as
ActionScript Code:
private function onViewMouseDown(me:MouseEvent):void
{
[code]....
View 0 Replies
Feb 18, 2012
I've been reading about the security restrictions for file uploads in Flash Player 10.According to the FileReference docs for upload(), the upload does not have to be triggered by a user-initiated action (the browse() does, but that's another story). If it did, that would force an awkward user experience for multi-file uploads, since only one upload can occur at once -- so the user would have to click (or press a button) once per file to initiate the upload, but only when the previous file had finished uploading.
[Code]...
View 2 Replies
Jan 28, 2009
I'm really wanting to incorporate this great floating text technique from levitated.net but updating the ActionScript for Flash Player 8 compatibility is beyond my knowledge. Can anyone lend a hand? Tnx.
[Code]...
View 2 Replies
Jan 11, 2011
Im working with AS3 and in my application I have a base SWF (with its document class) main.swf / main.as
And I have several SWF that includes a video inside with some navigation code (some buttons that I code in individual classes for each SWF). The problem is that I cannot find a method to load the swf's right, because the event that triggers the load process happens in the loaded SWF (the child).
View 1 Replies
Oct 25, 2008
My flex3 application downloads XML in e4x format from my web server, and and is left as a bindable XML object locally in my flex3 application. My visual objects then bind to various aspects of the XML object to display the data that I want.My simple program is getting more complicated, and I'd like to extend the XML object and add some functions to it, so I can keep the code that manipulates the XML object separate from my base application. Lets call this new object LoginXML.Can I please get an example of how to extend the XML object in flex3/as3 to create my own custom object with it's own functions. Part of my XML looks like
<nodes>
<node id="1">A</node>
<node id="2">B</node>
[code]......
View 9 Replies
Sep 19, 2006
Has anyone successfully updated Jerryscript's calendar to work with Flash Player 7?[code]...
View 4 Replies
Apr 13, 2009
if there's a way to automatically update the flash player if the user doesn't have the required version. If there's no way, can i make a button to download it directly from my site so the user doesn't have to go to the adobe webpage?
View 4 Replies
Feb 12, 2009
I'm new to FLEX.I've a requirement where i do have to load the data into Class Based Model(VO) from an Employee.xml which has got employeeName,departmentName,address & projectId tags.
View 0 Replies
Nov 18, 2011
I have a strange issue where Flash Player in Chrome is not updating unless the browser is resized. The app is an online design tool, written in Flex, and one of the features allows the user to upload an image and crop it. The image loads fine, and the crop action does not reload the image but uses Bitmap.copyPixels to create the cropped version.When I test on localhost (though a local server not just straight from the file system) the issue does not happen. However on our QA server the image does not appear unless you resize the browser, when I suppose a screen refresh is forced.I've tried all the usual suspects in AS3/Flex to force a redraw, updateAfterEvent, invalidateDisplayList, etc.we came up with is to resize the browser by a pixel, but this is obviously not ideal and I'd prefer a solution to a work-around.Here's the Bitmap code for reference...
var cropData:BitmapData = new BitmapData( _crop.width, _crop.height );
var originalData:BitmapData = new BitmapData( _loader.width, _loader.height );
originalData.draw( _loader );[code]....
View 3 Replies
Dec 2, 2010
I have built a class based on a calendar script found here on this forum. I have modified the script to work in a class and expanded on the calendar by checking each day of the month against a database to see if there are events on that day. (if there is an event, the day movie clip goes to another frame to highlight said day)Everything works great.. at first glance. The first time the calendar loads, all the days are properly in place and the Event.ADDED_TO_STAGES runs correctly, highlighting the dates with events.
The problem occurs when the user changes the month. Everything again works the way it should except for the Event.ADDED_TO_STAGE. This event only runs for each day the first time the calendar is loaded.
Code:
package classes {
//import necessary classes
import flash.events.*;
import flash.display.MovieClip;
[code].....
View 2 Replies
Feb 2, 2010
1046: Type was not found or was not a compile-time constant: FullScreenEvent.Warning: 3594: getStackTrace is not a recognized method of the dynamic class Error.Warning: 3590: void used where a Boolean value was expected. The expression will be type coerced to Boolean.Does anyone have any experience with these errors being thrown?
package {
import flash.display.*;
import FluidLayout.*;
[code]......
View 5 Replies
Dec 13, 2011
I'm just about to uninstall and reinstall at this point but I'm getting my install all screwed up trying to update Flash Pro CS5.5 to use Flash Player 11. I had it fine using the MXP provided in this adobe blog. Though that's 11.0 not 11.1. It did work however.
I downloaded the latest Flash Player / Debugger .exe and the latest SWC for 11.1 and now Stage3D is no longer being seen. Clearly I screwed something up. I uninstalled and reinstalled the MXP after deleting the FP11 XML and FP11 directory but it's not working anymore.
Is there a clear cut simple way to explain how to overlay the latest Flash Player for FPCS5.5? I used the AIR overlay instructions for 2.6 - 3.1 and it worked every time. Now I just need Flash Player overlay instructions. I'm very interested to start trying to Starling framework with Stage3D. I select FP11 to export and it tells me it can't find Stage3D.
View 1 Replies
May 8, 2011
I am trying to put together a simple game and have been doing really well until I decided I am going to have to create a new class to handle enemies.What I have so far is a player walking around on random terrains and I am up to the point where I have placed x amount of enemies on stage at appropriate times. I have written their class which will hopefully eventually handle their behavior and it outputs simple trace("BOO!").
Where I face the problem is that I obviously would like to make these enemies follow the player to attack. But when I try to access the .x or .y attributes of the player, it throws an error: 'call to a possibly undefined property with static type Class'?I have tried accessing the .x using the following ways (where badger is my player instance and Main is my class definition within the properties of the FLA):
Main.badger.x
Main(root).badger.x
Stage.badger.x
I have also tried to access other vars and still nope..My class code is this:
Code:
package
{
import flash.display.MovieClip
import flash.display.Stage
[code]....
View 1 Replies
Apr 10, 2011
As it is said here: [URL] "If you do a Google search today for "MVVM and Flex", the first post is by somebody who claims that MVVM is not a good fit for Flex. I couldn't disagree more. Out of the box, the Flex framework makes it much easier to implement a Presentation Model than similar MVVM implementations in Silverlight. That is not to say that there aren't good third-party libraries that make it easier in Silverlight, but without any help, it is easier to do in Flex." So MVVM as LOGICAL CONCEPT can be implemented in both but the way it is implemented in Silverlight requires more Plumbing than Flex.
What prevents Silverlight MVVM to be implemented like Flex ? Doesn't Silverlight have same capability in event system to do the same? If yes why does Silverlight do things more complicated what's the advantages then ? Is it about using Class Interfaces which are more strongly typed? What are the disadvantages also ? For example as for implementing MULTIPLE VIEWS for 1 View-Model does Flex implementation make it also more obvious?
View 2 Replies
Nov 24, 2011
I have the following inheritance structure:
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.
View 1 Replies
May 3, 2009
I've got an external .as file in the same folder as my flash file. In the process of writing the code, whenever I make a change and then test the movie, the flash movie is obviously still looking at the OLD information. I tried using the "Delete ASO Files" on the menu, to no avail.I can' find these ASO files anywhere on mycomputer.Aha! I tried something else. I quit flash,restarted and ran the same script with no changes. It returned the data correctly, but then gave me this unpleasant message:256 levels of recursion were exceeded in one action list.This is probably an infinite loop.Further execution of actions has been disabled in this movie.There are no loops of any kind in the code, which is below.
//This is the Person.as file:
class Person { public var HomName:String = "unknown"; public var HomEmail:String = "unknown"; public var HomPhone:String = "unknown"; public var HomSaveFreq:Number = 0;
[code]......
View 27 Replies
Jul 25, 2009
I want to add this function to my videoplayer class :
Code:
private function onProgress(e:ProgressEvent):void{
var percent:Number = e.bytesLoaded / e.bytesTotal;
[code].....
View 4 Replies
May 25, 2009
Ive start to use the new FileReference class (FP 10) and I create a local image viewer with a loader and bitmap. But now I want to take it one step further and make a local FLV Player. I need a SWF file, so for that reason Im not using AIR.What class should I use to play the video? This is part of the code I use for the image viewer.
Code: Select allpackage
{
import fl.controls.Button;[code].....
View 14 Replies
Apr 7, 2006
I have a class called Player that extends Movieclip? Why wont my code to attach a movie clip work?
Code:
import GAME_CLASSES.*;
Player1 = new Player()
Player1.setName("BobZdog")
Player1.attachMovie( "MainChar" , "Character1", 75)
Player1._x = 100
Player1._y = 100
[Code] .....
View 2 Replies
May 19, 2011
how to access the Sound () Class from the youtube player? Worst case scenario, is it possible to ling a new Sound() to a MovieClip?
View 7 Replies
Feb 14, 2011
I'm an actionscript beginner and trying to write a class to make the 'enemies' follow the 'player' (shown below). I'm trying to write it such that it takes two MovieClips as arguments, and moves the first one toward the second one. When I import the Class try to use it in Main.as by typing " var followPlayer:FollowPlayer = new FollowPlayer(fishMov0, player);", I get the following error:
"ArgumentError: Error #1063: Argument count mismatch on jab.enemy::FollowPlayer/followPlayer(). Expected 2, got 1."
[Code]...
View 3 Replies
Jun 21, 2011
I have a simple input box with an on-screen keyboard. When I type into the box using the on-screen keyboard (adding characters to the box programatically) the Selection class overall isn't letting me control the input.I'm assuming this is a scope issue of some sort. The input belongs to one class while the onscreen keyboard belongs to another.Is the Selection glass global or is it class-scoped? Even when I pass a reference from one class to another and request Selection.getCaratIndex() from the class that generated the input it continually returns -1 which is not correct.The kicker is I can make a new AS2 document, put an input box on the screen, add text to it (all programmatically), Selection.setFocus() the input, run Selection.setSelection() to the last index of the input and Selection.getCaratIndex() returns the valid number. So there's something funky going on when classes are involved.
The only way the Selection class is working is if I use a real keyboard or mouse click, then it works fine. This isn't very useful in an on-screen keyboard context however.Are there any mines I should avoid when using the Selection class in an application where multiple other classes are involved? Is Selection really global or should I worry about scope with it?
View 3 Replies
Sep 11, 2009
I recently found a method (ByteArray.clear()) that FlexBuilder complains is possibly undefined; however, the method is in fact documented in the Flex LiveDocs. It must have been added in a later version of the SDK than I have installed. I'm not asking about this particular method, but I'm giving it as an example of the documentation issue that I'm trying to resolve. My questions are:
How can I determine what version of the SDK or Flash player that a method or property was added in? How can I tell which versions of the SDK are supported on which Flash player versions?
I want to be able to determine from the documentation, instead of compiler or runtime errors, what SDK and Flash player versions are needed to support newly added methods.
With Java I look for the @since javadoc tag when I need to know this, but I can't find an equivalent feature in the Flex docs.
View 3 Replies
Mar 15, 2012
I am within a class, "Enemy". This class has a function "collision". How can I communicate with the amount of lives a player has left from within this class?
View 1 Replies
Apr 7, 2009
My aim is to access the FileReference class Flash Player 10 properties,methods and Events using CS3 instead of CS4.For load() ,save() methods needs runtime version of Flash Player 10.I need to include the flash player 10 in CS3 publish settings Version.Otherwise you can suggest how i can able to access the FileReference class new properties and methods without CS4.
View 1 Replies
Feb 5, 2010
I am trying to retrieve the ByteArray from a file selected using the FileReference class so that I can pass this to a Web Service call that I am making to Sharepoint.Is there any way I can do this using Flash Player 9 without having to upload to a remote server first and then downloading the file to extract the ByteArray?
This is assuming you can't use Adobe Flash Player 10 and the data property from the FileReference class.
View 1 Replies
Apr 12, 2011
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:
import flash.net.URLLoader;
import flash.events.Event;
import flash.net.URLRequest;[code]...............
View 2 Replies
May 7, 2009
I would like to take advantage of all the goodness of the newer Vector class for FP10, but it seems it is marked as final. I am doing some intensive mathematical processing in Actionscript, and repeatedly process arrays of Numbers. I have previously been using my own subclass of Array(I call it NumericArray), with added functions such as sum(), mean(), add(), multiply(), etc. This works very well and allows for some clean OO code. However, I am finding through profiling that about 95% of my processing time occurs in the functions of these objects. I need more performance out of these arrays.
I want to use a Vector, as it provides some performance enhancements. I want to specifically use a Vector.<Number>. Unfortunately, I cannot subclass Vector as it is marked final. What is the best and cleanest way to imitate what I was previously doing with a subclass of Array, to a Vector.<Number>?
I have thought about passing around Vector.<Number> variables instead of my custom class and just using utility functions to manipulate, but this is not good OO design and will be a pain to use, not to mention ugly.
View 3 Replies
Nov 14, 2009
How do I change the frame of my timeline from my player class. I cannot just write gotoAndStop() because it will change the frame of the player not the timeline. I figured I would try this:
[Code]...
View 2 Replies