ActionScript 2.0 :: Linking Image To Song It Represents When Playing
Mar 26, 2011
For the music player that I've designed and am making come to life in actionscript 2.0, I'd like to have a custom made image be shown for the entirety of the song that it corresponds to. I've already made the images for each of the three songs, but now I just need to figure out how to make them show inside the player every time it's matching song plays. I should add, that I've made a default image for the player as well, that I'd like to be shown, whenever a song is not playing.
Additionally, there is a "Play All Songs" button that is already operational on the player and plays 3 songs in succession. How would I go about adding the 3 images to be shown consecutively, as each song plays? The way the button is set up, I joined all 3 of the songs together with a 3 second space in between, as a single music file. So the button contains only one file that plays all 3 songs, not a separate one for each of the them.
View 9 Replies
Similar Posts:
Aug 19, 2009
I have a list of mp3-songs, when song 1 is clicked it gets streamed, a stop-button appears, if this Btn is clicked, this Btn disappears as it should - but if user forgets to click for stopping sound and clicks song 2, stopBtn 1 remains and the new stopBtn 2 also appears. there should be only one stopBtn, the one next to the song is playing.
I would like to move the stopBtn and I have tried several approaches move; graphics.moveTo; if(stopButton !=null) {removeChild (stopButton)}; I packed the var stopButton:Sprite in the header and so on.
Code:
SoundMixer.stopAll();
import flash.display.Sprite;[code]..........
View 0 Replies
Dec 10, 2011
I'm trying to create a class that represents all 52 playing card (Suit and Value), and I'm having difficulties. I'll then create a function in my Document class that compares two card objects as parameters and traces out which one would win in a fight (aka War).
View 3 Replies
Nov 13, 2010
I have a sound clip that I'm loading externally into my flash file. The code I'm using looks like this and is placed in the as layer on the first frame,
var mySound:Sound = new Sound();
var myChannel:SoundChannel = new SoundChannel();
var myTransform = new SoundTransform();
var lastPosition:Number = 0;
mySound.load(new URLRequest("introaudio.mp3"));
myChannel = mySound.play();
[Code]....
View 14 Replies
Apr 13, 2010
The problem I have is I click the play button and start playing. Then I click next and when I click play for another song the songs overlap. How can I stop whatever song is playing and start playing the new one? Has to stop the prev song when I click play_brn.
[Code]...
View 2 Replies
Sep 14, 2011
I have an mp3 file that i dragged into a layer, which starts playing at the beginning of my movie.if i preview, i can hear it playing.
annoying problem is that if i stop or pause the preview, the music keeps playing and if i start it again, another instance of the audio track starts playing again so that they are playing at the same time.
View 1 Replies
Oct 7, 2009
I have a play button and stop button when I click on the play button the song keeps repeating over and over. How to stop this? This is the code I'm using:
var req:URLRequest = new URLRequest("song.mp3");
var sound:Sound = new Sound();
var controller:SoundChannel;
function soundLoaded(event:Event):void {
controller = sound.play();
[Code] .....
View 2 Replies
Apr 28, 2010
I have developed a Player where I am using FMS to play MP3 files, it works great in normal scenario but when user keep on clicking new songs from Song List (List Component) then the player stated playing all songs. Which It should not do. Is there a way that we can unload previous song before loading new song.
View 5 Replies
Mar 15, 2012
okay.. i'm using a xml n URLrequest to bring up the song n song list in a listbox but, I want the song hold for x seconds (because there r a silent opening first, then I want the the song start when the silent opening ends). Perhaps there r code to add delay just to the song so it not autoplay? Plus I dont know where to put the code..
here's the code for frame 1
[Code]...
View 6 Replies
Dec 22, 2010
I downloaded player from [URL].. but I don't know why what the problem it had with with playlist. I had a playlist in xml file with songs. When i deleted the mp3 from the server, it is still playing. and when i changed the mp3 files it is still playing the original files. I don't know where these files were saved. I thought it was saved in my browser cache and i cleared it but it didn't work. I thought it was cached in my server, but in my localserver , i had the same problem.
So, again i downloaded the player, and this time it played different song, that i put. I have a hypothesis. Does flash player (swf object) absorb mp3 files?? i don't think so but how come player is playing the mp3 that has been changed or deleted? if it was in server cache then how long will it take to clear the cache and play new file. However, i don't remember coding something like 'cache'
View 2 Replies
Jan 17, 2012
I'm playing a song and syncing up some visual changes with that song. The issue is that in order for the song to play when I preview my changes to the animation, I have to start playing my flash project from frame 0. This becomes a problem when I am trying to sync to things that occur later in the song. For example, if I'm trying to sync something at frame 300 then I have to re-play the entire animation from frame 0 in order to hear the song at frame 300 and beyond.
Is there any way to get the song to play, starting from the correct position, regardless of where I start running my animation while developing? I could hack something up in action script to move the play head and play the song if it currently isn't being played but I'd rather not go down that route as there must be a simple solution to this problem.
View 2 Replies
Jan 28, 2010
i'm just new to actionscript, how will i trigger an javascript function when i click the button play and also when i finished playing an mp3 file song?
View 0 Replies
Mar 17, 2007
I have made a combobox and I am trying to make it so that when I press a button, the song that is selected plays. I have this code already but it doesn't work.
ActionScript Code:
song1 = new Sound();
song1.attachSound("pdandcos");
song2 = new Sound();
song2.attachSound("pieman");
song = song1;
play_btn.onRelease = function() {
song = songlist_cb.value;
song.start();
};
View 1 Replies
Apr 13, 2009
I'm making music visualization in papervision3d using FlashDevelop. The script generates 150 cubes each acting as different tone (from basses with red colors to high notes with blue).The song starts, everything works fine, but after 44 seconds song stops. I hadn't wrote function that would do that. I've turned off every useless visual functions and even papervision3d rendering. The scene is just black and the song still stops playing after 44 seconds.File is included with:
Code:
[Embed(source = "../assets/8bp069-05-she-session.mp3")]
because I'm not writing it in flash.
I've tried different song and it stops after 1:10...Flash uses ~30MB of Ram and 50% of my Athlonx2 64 2.6Ghz in action.
Here's some code: sound
Code:
[Embed(source = "../assets/8bp069-03-she-pioneer.mp3")]
private var Music:Class;
private var sp:Sound = new Music();[code].........
those last 3 functions have nothing to do with playback.Am I doing something wrong with computeSpectrum function? Here's the scrieennie of it in action: Of course it's like an alpha version of what I'm planning to do.
View 1 Replies
Feb 15, 2010
I am writing a mp3 player and having some issue getting the song length before the entire song has been loaded - which messes with my position indicator, as it needs to know the track length. I thought I could get the length from an ID3 tag, problem is ID3.TLEN returns undefined, though if I right click the track and show properties, the summary tab shows song duration, bitrate, etc... how I can retrieve the song length before the entire thing has been downloaded?
View 4 Replies
Aug 7, 2010
I have 5 frames in which a different song will be playing, this is the code i used on each frame:
var mySound:Sound = new Sound();mySound.load(new URLRequest("frameone.mp3"));mySound.play();
If im on frame 1 and click on the navigation button to see frame 2, both songs on these frames play simultaniously. how can i stop the background song on frame 1, and have frame 2 playing?
View 11 Replies
Apr 1, 2011
I am creating a vertical shooter game for one of my assessments. There are 4 levels in the game, the object of each level is to shoot as many enemies (spawn via an external as file) to build up your score before the time runs out. Once the time reaches zero, you get linked to the next level. The first level is called the graveyard which has skulls as enemies. Once the time reaches zero, this swf automatically links to the next level which is called haunted_house.swf. The only problem is the skulls from the first level continue to spawn on the new level. How do I stop this? The coding for the timer and to link the first level to the next is below:
[CODE]...
View 2 Replies
Jul 8, 2006
With AS1/2 there was no way(that I know of) to determine the document size at runtime. You had to hard code in some vars. Although Stage.width and Stage.height would be the same as the document size when scaleMode is not 'noScale', if scaleMode is indeed 'noScale' then Stage.height and Stage.width represent the SWF size. This behavior appears the same in AS3, but I was wondering if there's any additions that make it possible?
View 3 Replies
Apr 4, 2009
How to make a link to the other text/image contents in flash pro 8. I have now created one swf file and I intent to create/ add some more pages.contents are lengthy and I want to use text to scroll by using The Flashtuning Scroll Bar or using Uiscroolbar from the components. When I click the linkbuttons the link pages should open/in the flash itslef. SWF file is in [URL].
View 1 Replies
Jan 15, 2009
I have a flash image rotator that is controlled by an XML file that looks like this:
[code]...
how do i add links to each of these images
View 1 Replies
Nov 17, 2011
I've been using a custom base class with an id property that is automatically assigned by a manager class when an instance is created. I use this value in multiple ways and require it to differentiate each instance.
I want to remove the need for my own base class but still have a way to tell instances throughout my application apart.
Is there a property set on all objects in ActionScript 3 that can act as a unique identifier?
View 1 Replies
Jun 29, 2011
Lets say I have 3 MovieClips. One that is animation that represents animated overlay of entire stage. Like falling leafs (for example)
One that represents character
One that represents background
I want to make character to be MouseEvent.CLICK interactive. The problem is when I create a particle Animation of falling leafs the single leaf that is an instance of MovieClip blocks Character mouse Interaction. Is there a qay to fix container that holds the particle animation of Leafs so that it will not block Mouse Interaction whit mc below?
View 1 Replies
Apr 9, 2009
I've made an image map in Flash using AS3, however it does not seem to be working properly. The links only work in a strange succession. In order to click all the links you must first click the last link followed by the first link, then the second link. After that the image map behaves as it is supposed to. I'm not sure why this is happening. It complies without error and aside from the little quirk mentioned above, it works beautifully. I've checked and double checked the AS, even copied and pasted some code from one button to another to see if it would make a difference, but to no avail. I am using the code listed below:
[quote] button1.addEventListener(MouseEvent.CLICK, callLink1); function callLink1 (event: MouseEvent) :void { var url:String = ("http://www.google.com"); var request:URLRequest = new URLRequest (url); try { navigateToURL (request, "_parent"); } catch (e:Error) { trace ("Error occurred!"); } [/quote]
View 4 Replies
Dec 5, 2006
im trying to make this menu, just having one small problem linking the image or movieclip in the libary to the blank movie clip called instant name icon_img i have a movie clip called mp3_icon with an linkage ID of mp3_icon
Code:
b1.onRollOver = over;
b1.onRollOut = out;
b1.buttText.buttonText.text = "Main Conference Day One - Neil Watson";
b1.buttDesc.buttonDesc.text = "Developing finace Management";[code]....
View 1 Replies
Jun 22, 2010
Yesterday I spotted what seemed to be a minor issue with having a linked image in a dynamic textField. Basically, this doesn't work as expected:
HTML Code:
myField.htmlText = "<a href="[URL]"><img src="image1.jpg" /></a>";
You get the hand cursor when you mouse over the image, but clicking does nothing, unless you inadvertantly click an invisible 1px border around the image.
I've tried:
Loading an external image (<img src="images/image.jpg" />)
Loading a bitmap in the library (img src="myImage" />)
Loading a movieclip from the library (img src="myMC" />)Using textField.getImageReference:
myField.htmlText = "<a href="[URL]"><img src="image1.jpg" id="myImage" /></a>";
var imageButton:DisplayObject = myField.getImageReference("myImage");
imageButton.buttonMode = true;
But absolutely nothing works. All of the data being loaded is from a database, and I've got a couple of lengthy methods in mind that I could use to dynamically attach movieclips with link references, but it involves edits to MySQL, the XML output and a couple of PHP files, as well as the AS.
After a creating a new test file from scratch, it seems that the real culprit is when you embed a font into the textfield. I initially tested a new textfield with absolutely no formatting and the linked image worked perfectly. As soon as I added a font to the library and embedded that into my textfield, the link stopped working.
View 2 Replies
Jul 6, 2010
I need help figuring out the code that will allow a button that is outside of an XML gallery to go to a specific image in an xml gallery. Specifically, i need to link a thumbnail, that is on a different frame then my xml gallery, to the corresponding image in that gallery.
View 0 Replies
Nov 28, 2007
I have made a image-viewer. I've this AS for the viewer:
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
function loadXML(loaded) {[code].....
Now i would like to make a loop for the thumbnails so they don't have a beginning or end(Now when i scroll to the right the thumbnails stop at the last thumbnail, i want it to begin at the first thumb again).I'm also trying to make that the middle thumbnail represents the photo in target_mc.
View 1 Replies
Mar 5, 2011
Array of color id-s represents a 3D Array of values. I've represented each value with a color(Blue is 1, Red is 2 and Green is 3). So for the example the array for the image would be[code]...
Now, I have an array of predefined shapes/objects. I'd like to replace the grouped colors with the shapes that I have. I'd like this to follow the rule of finding the largest shape first and then down to the smallest one. [code]...
View 1 Replies
Jul 28, 2009
the project im working on is all database driven, there are no html files and all coding that is created is made by php then stored within a db to be called later on. now because of this i can't use relative links at all with anything i.e. images, videos and swf files.
so.....i am using swfobject to link to a swf file using absolute linking as shown in the coding below. but what i need to do now is link an .as file in my swf using absolute linking so i can call some arrays from the file.i have doubled checked to make sure my vars can be passed by local testing and it works but now i need it as absolute....is this possible?
View 16 Replies
Jun 26, 2009
In Flex, say I have a Class object. How do I get a string for the class it represents?
e.g.:
var clazz:Class= String;
trace(clazz); // this gives "[class String]" but what I want is "String"
View 5 Replies