Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Problem With Mp3 Player



I'm building an mp3 player that finally seems like it's coming together. Back and forth works fine now. So I tried taking it to the next level by adding those bouncing bars that you see in most music players like winamp. Problem is. I just followed a tutorial, and by themselves the bars work fine but when I try to encase them in a function that I want to execute once the music is loaded the bars only jump once and then they stay flat. Any idea what's wrong.
ActionScript Code:
stop();// Preloader variablesvar t = 0;var l = 0;var p = 0;// --------------------------<load and loop sound>-------------------------- \this.createTextField("status_txt", this.getNextHighestDepth(), 72, 630, 100, 22);// create a new Sound objectvar my_sound:Sound = new Sound();musictext.text = "loading";// if the sound loads, play it; if not, trace failure loadingmy_sound.onLoad = function(success:Boolean) {    if (success) {        my_sound.start();        musictext.text = "music on";        _root.preloader._visible = false;        antiShane();    } else {        status_txt.text = "Sound failed";    }};// load the soundmyCount = 0;totCount = 1;mySongs = ['song1.mp3', 'song2.mp3', 'song3.mp3'];nextTrack = function () {    my_sound.loadSound(mySongs[myCount], false);    this.onEnterFrame = function() {        //trace(t);        //trace(p);        //trace(l);        t = my_sound.getBytesTotal();        l = my_sound.getBytesLoaded();        if ((t>0) && (t != null)) {            p = (l/t)*100;            p = int(p)+1;            preloader.gotoAndStop(p);        }        if (l == t) {            delete this.onEnterFrame;        }    };};/*var songnr:Array = ['song0','song1']my_sound.loadSound("song"+i+".mp3", true);trace(i);}*/// loop the soundmy_sound.onSoundComplete = function() {    my_sound.start();};// --------------------------</load and loop sound>-------------------------- \// ------------------------------<Play Stop button function>------------------------------ \var playstat:String;playstat = 'on';control.onRelease = function() {    if (playstat != 'off') {        gotoAndStop(2);        playstat = 'off';        my_sound.stop();        musictext.text = "music off";        //trace (playstat);    } else if (playstat != 'on') {        gotoAndStop(1);        playstat = 'on';        my_sound.start();        musictext.text = "music on";        this.nextTrack();        _root.preloader._visible = true;        //trace (playstat);        trace(mySongs[myCount]);    }};nxt_btn.onRelease = function() {    if (myCount == totCount) {        myCount = 0    }    else {        myCount++;    }    nextTrack();    _root.preloader._visible = true;    trace(myCount);};prev_btn.onRelease = function() {    if (myCount == 0) {        myCount = totCount    }    else {        myCount--;    }    nextTrack();    _root.preloader._visible = true;    trace(myCount);};nextTrack();// ------------------------------</Play Stop button function>------------------------------ \antiShane = function () {    // ----------------------------------------<Animated Bars>------------------------------------- \    // Project: make a fake equalizer like movie clip for use when music is playing in Flash    // project has lines and toppers, each labeled linex & topperx where x is 1 to 20.    // the lines make up the tall parts of the equalizer, the toppers are just a line placeholder    // for the max value of the lines     // define initial arrays     barboty = new Array();    //holds bottom of each line's _y registration point    randheight = new Array();    //holds randomly generated height of line    toppery = new Array();    //holds _y registration point of topper     decfraction = new Array();    //holds the fraction of random height of line that will be used to decrement the line's height     numbars = 6;    //defines number of lines    maxheight = 15;    //defines max height of line    minheight = 1;    //defines min height of line    gap = 2;    //defines distance between top of line and topper    topperdrop = .075;    //defines value to decrement _y value of topper    numsteps = 7;    //defines number of steps to decrement height of line    // this function sets values for the heights of each line in the equalizer    function initbars() {        for (i=1; i<_root.numbars+1; i += 1) {            barboty[i] = eval("_root.line"+i)._y;            randheight[i] = Math.random()*maxheight;            toppery[i] = barboty[i]-randheight[i]-gap;            decfraction[i] = randheight[i]/(_root.numsteps);            // set initial line height and position of topper            setProperty(eval("_root.line"+i), _height, _root.randheight[i]+_root.minheight);            setProperty(eval("_root.topper"+i), _y, barboty[i]-randheight[i]-_root.gap-_root.minheight);        }    }    // this function will get executed at the playing frame rate of the movie, even if the movie is stopped     _root.onEnterFrame = function() {        for (j=1; j<_root.numbars+1; j += 1) {            //set height of each line for each j in numbars            setProperty(eval("_root.line"+j), _height, _root.randheight[j]);            if (_root.randheight[j]<=_root.minheight) {                // if the line height is less than the min, then:                // set line height to the min then redo the line heights etc                setProperty(eval("_root.line"+j), _height, _root.minheight);                _root.initbars();                // the entire function initbars could be placed here if you like rather than being called.            } else {                //if not too short, decrement height of lines and position of topper                _root.randheight[j] = _root.randheight[j]-_root.decfraction[j];                setProperty(eval("_root.topper"+j), _y, eval("_root.topper"+j)._y+_root.topperdrop);            }        }    };    // ----------------------------------------</Animated Bars>------------------------------------- \};
The bars are encased in the function 'anitShane' cause of an internal joke in case anyone was wondering. thx in advance.



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 04-11-2006, 07:25 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[F8] 2 Flash Objects - Audio Player Passes Pause To Video Player
I have 2 flash objects on my html page.

One is a video player and the other is an audio player.

The video player starts playing by default.

I'd like to somehow set this up so that if someone clicks on the audio player, it automatically pauses the video player.

Please note that these are 2 SEPARATE FLASH OBJECTS on my HTML website. I'm not developing an all Flash driven website.

The audio player was added as an afterthought, originally there was only going to be a video player on the page.

How can I send a pause command from the Audio Player to the Video Player?

FOO

How Do I *completely* Uninstall Flash Player And Then Install The *full* Player?
I lost the ability to to hear the audio on YouTube videos and other (e.g., news feed sites) videos served via Flash Player. Several people who encountered this problem claim to have solved it by reinstalling Flash Player. This has not helped me, though the Adobe sites I download from all serve up either the Flash Player *plugin* or the ActiveX player (I prefer Firefox to IE).

The uninstallers I've downloaded from Adobe run in a few seconds, and I suspect are not doing a complete uninstall. If I search my registry for "Flash" or "Macromed" I find many, many entries. Is there a special utility that will do a complete cleanout of Flash registry items and files?

Is there a site where I can download the *full* player, not just the plugin?

One point of information about my problem, however, that makes me think it is not a problem with the Flash Player itself is that I've also lost all Windows sounds (which I find mostly annoying, so I don't mind that), and there's no Windows sound icon in the system tray.

I *am* able to play (and hear) mp3 and wma files played directly off my hard drive. So I think the sound card and audio device drivers (mine is SoundMAX Digital Audio) are fine.

I've gone through the various "solutions" that fixed this for others--codecs replacements, cookie clearing, regisry repair utilities, I even reinstalled the audio driver from the Gateway disk.

I'm stumped and am almost tempted to buy an external (USB) sound card and try directing Flash to it.

But I'm sure there's another solution.

Oh, this is XP SP3 (upgraded to SP3 *after* the problem manifested).

- Willie





























Edited: 08/30/2008 at 11:43:16 AM by WillieGWilliams

Windows Media Player Or Real Player Through Flash
Not sure if this can be answered all that easily, but does anyone know of a way for streaming video to be displayed through a flash movie. My guess is that it has something to do with java script and Active X. If anyone know any possible directions I can go with this, it would be greatly appreciated. Thanks - J

Kallok Music Player V.1.0 (stand Alone Flash Mp3 Player)
Hello! Ive been working on a flash music player that will be able to play music on a website or you can use it as a stand alone player.It is expected to come out late July.It will be a free player,possibly a ultra version for about 5.00 sometime after v.1 comes out.Hopefully people will like this I already got a lot of work into it. If you wanna see a preview of what it loks like (non working) go to http://www.k-player.cjb.net .If anyone is interested in adding or helping out email me at webmaster@sei-inc.com !My webdesign site is being rebuilt but it will be kallok.com.More info about that some other time.

FLash Cd Player .cda Files Launching Media Player?
So I need a solution to this problem. I dont know if it can be solved in flash but any help would be great. I'm making an Enhanced cd. If you pop it in you cd rom it autolaunches a flash movie. There are two options one to goto the website contained on the cd the second to listen to the audio files. Is there a way to launch a media player or open the .cda files with flash so when you click the listen button it starts the cd? help. It needs to play in a cd player otherwise this owuldn't be a problem.

[MX] Closing Flash Player Or Window Projector Player
I know this is pure lazy deal. Is there a script that at the end of the movie clip or slide show it automatic close flash player or close Window Projector?

[CS3] Trying To Make 2 Player Tetris Game With 1 Player Code
So I picked up a Tetris tutorial from Webdesign.org made by Tutorialscene.org.

Instead of just copy and pasting the code I went through every line in the tutorial typing it in manually. So I have a kind of decent idea of what's going on in the code but I'm no expert by any means.

I know that for two games I'd have to have seperate key inputs which I've figured out how to do. Up, Down, Left, Right for player 1 and W, S, A, D for player 2. Down however does not work and it's moving pieces around on the 1st player screen.

Basically to make it as easy to get what I'm trying to do across I'm posting the 2 swf's and the fla below.

This is the one player version:
http://www.cycloneinjapan.com/upload...1/tetris-1.swf

Works fine.

This is the broken 2 player

http://www.cycloneinjapan.com/upload...r%20broken.swf

And here is the fla.

http://www.cycloneinjapan.com/upload...tetris%202.fla

If anyone can give me some pointers or help me out it'd be greatly appreciated.

Site Working Under Player 9.0.47 Or Later, But Not Older Player 9 Versions
Hi all,

I've discovered that all my as3 websites are fine with flash player 9.0.47.0 or later but not older sub versions of player 9. The problem seems to be located after the preloading of the site but I can't figure what is happening exactly.

I've checked my code and I don't do anything special. I load the Root, than some XML, and then I jump to the third frame and init the site. There are some movieclips on frame 2 for preloading purpose.

I would really like to understand what's the difference between those flash player versions that causes my website to stop after the loading, in all versions between and including 9.0.16.0 -> 9.0.45.0.

Here are two of those problematic websites :
www.dankastudio.fr
www.robinsonlesbains.com
www.asylum.fr

Thanks a lot,
Greg

XSPF PLayer, Webjay.org, Flash Player Woes.... What Do You See?
Hi All,

I'm working on making a jukebox, which, to me works in Firefox on Mac, and IE 6 in Windows.... can you guys check it in your browsers and let me know what you see, and if it works? My client says that it isn't working, but I've tried it in all browsers and to me, it seems to work.

Here's the URLs that have the jukebox code on it:
http://donohoemusic.com/index.php?page=projects

http://donohoemusic.com/index.php?pa...-book-of-songs

I'm not really sure what's going on, whether or not he needs to update his flash player, run another browser or what...
To create the jukebox, I logged into Webjay.org, and made the list, hard coding where each MP3 was on the server, as well as the images. then I outputted the code and pasted it into my cms made simple pages.

Could any of those elements be conflicting? For now, I just want to see if it's working for everyone else.

Thanks for the help!
God Bless!
Josh

PS. I'm using Webjay.org, XSPF player and CMS made simple and I'm on Mac/firefox, win/IE 6

Detect If Browser Has Flash Player And Get Player Version
Hi guys,

  do you have on how to detect if the browser has flash player? and also can detect the flash player version installed on the current browser.

thanks in advance.

Player In Flash - Open URL In Player Player_.swf?mus=http://URL
Good night friends, all right?

I am new in flash and would like a their small help.

I did a player in flash for got her legal. The problem is that the project grew and I now want to open with the database. Tava thinking of something as player_.swf?mus=http://www.link.com/music.mp3

Would anybody know how can do so that my player flash does it open the musics this way?

The project structure is +/- this way:

I have a field input, with the variable "music". Have a button with the name music_btn.

I put the music in this field and pressure the button and the music starts to touch

Action Script:
------------------------------------------------------------------------
This.music_btn.onRelease = function(){
Musica_sound = new Sound(_root);
Musica_sound.loadSound(music,true);
}
------------------------------------------------------------------------

What I wanted to do was to pull for database URL and to put for URL in player. player_.swf?mus=URL

Please, they could help?

Thank you very much at once!

Pop Up Audio Player Silencing Page Player
I recently added a pop up player to my site, which pops up the audio player in a new window if you care to listen while navigating other pages (or want to listen without having the songs start over each time you change a page, because i'm working primarily html, and only using a flash player, so each time you load a new page it starts over). What i'm wondering is if there is some kind of global function that will have the media player on the page check if the pop up player is playing, and if it is, then not to start the audio. I'm not sure if that makes sense or not, but basically i want one audio player to be playing at a time, so you don't have songs clashing against each other.

Updating File From Player 6 To Player 7...can't Get It Working Right
I need to migrate this file from FP6 to FP7 and i thought it would be as easy as just declaring the variables and making some changes here and there, but apparently not. I also need to find a way to delete an onEnterFrame when mouse is not moving, but then stat it back up again, when the mouse starts moving.( I figure it will help cut down on processor load ). Anyway, attached is the file i need some help with. Any help/suggestions etc woud be appreciated.

Oh...Also... if anyone can think of way to make the same effect work on buttons/mc's within external clips loaded into a container, that would be much appreciated as well... everything i have tried has been unsuccessful..

thanks in advance

Publish To Player 6, Will Not Play On Player 8, News To Me
In my years of using flash, and publishing movies for 'different players' I just realized that a movie published for Flash Player 6, will not work if you only have Flash Player 8 installed!! This is not what I was to believe about F8.
Is this really right? I only realized this because I completely cleaned out my computer of all kinds of 'temp' this and that, registry entries, and also clearing nearly everything to do with active x and shockwave components.
So, I really thought that a movie published for Player 6 would play on any computer that had Player 8 installed. NOT THE CASE !

Can anyone backup this statement?

Video Player Component Using Flash Player 6
I'm streaming video using Flash Player 6. The problem I am having is that the video will only play at a super small size, something like 180 x 60 (that's a guess). Is there a way to play the video at the 320 width that I redered it as?
I'm using Flash Player 6 because some code that came with my purchased Flash Template does not work unless it's published to Flash Plaey 6.
Thanks in advance!

Flash Player Vs Windows Media Player
Hi,
I am trying to decide between Flash and Windows Media to stream video content form a web server. I would like to go with Flash but do not want to do so at the expense of reduced video quality. My questions are:

1> Will Flash have an ability to show videos on Full Screen mode? If so, when should we expect that to happen?
2> Does Flash support variable bit rate encoding? If not, when do you think it would? How does Flash encoding compare with Windows Media encoding?
3> Besides the player being available on most browsers, does Flash have any other advantage over Windows Media Player?

Flash Player 10 Component Player Skins Gone
Anyone know how to fix this issue? I installed flash player 10 this morning and now videos that had a component player skin on them do not have them any longer.

Preloader, Worked In Player 6, Broken In Player 8
Hi guys!

I started with a .fla that was in version 6 and used this actionscript. Later on a made some changes that required player 8. And offcourse my preloader went shot down in flames

Could anyone please see what could possibly be wrong?

ActionScript Code:
lBytes = _root.getBytesLoaded();
tBytes = _root.getBytesTotal();
percentLoaded = Math.floor((lBytes/tBytes)*100);
loader.bar._xscale = percentLoaded;
loader.percent.text = percentLoaded + "% of " + Math.floor(tBytes/1024) + "K loaded.";
if (lBytes>=tBytes && tBytes>0) {
if (count>=12) {
gotoAndPlay(25);
} else {
count++;
gotoAndPlay("preload");
}
} else {
gotoAndPlay("preload");
}




Thanx in advance!

How To Make My Player 6 Code Work In Player 7?
hiya,

does anyone know if it's possible to change this code so that it works when exported as 7 instead of 6??

i have a thumbnail slider that brings in images from XML. the XML bit works in 7 so
i think it's all going wrong at the slider code below:


// MAKES THE THUMBAILS SLIDE USING NEXT & PREVIOUS BUTTONS
function SlideMenu() {

this._x += (newX - this._x + thumbWidth) / 5;

// stops the thumbs at the first one
if (menu_mc._x >= 116) {
menu_mc._x = 116;

// stops thumbs at the end.
} else if (menu_mc._x < -(imageCount) ) {
menu_mc._x = -(imageCount);
//trace ("imagecount: " + (imageCount - endThumbBox));
}
}
// This next line calls the funtion named SlideMenu
menu_mc.onEnterFrame = SlideMenu;
delete this.onEnterFrame;


// next & back buttons
previous_mc.onRelease = function() {
XNumber++ ;
newX =- XNumber * -580;
}
next_mc.onRelease = function() {
XNumber-- ;
newX =- XNumber * -580;
}


i'd really like it to work with 7 cos i've since figured out that css only works with player 7 & up...

hope that it's a simple problem to solve (i'm pretty new to this) & someone can help me out

cheers
naoimh

Different Drawing Handle Between IDE Player And Standalone Player.
I've made Jigsaw puzzle component. http://www.winx.ws/IdeStandDifference.jpg When I test thru IDE everything is fine. (picture left) When I start the swf with standalone player by clicking twice the pieces become broken. (picture right) Can figure out how the drawing points are different or what? Is it some alignment or setting don't know. Exe publishing is fine too. And calling drawing classes without component has same issue. I've try to put stage.scale=No scale and stage.align=TL no changes. I'm getting mad. Thx

Works In Test Player But Not On Flash Player
Does anyone know why a SWF that loads another SWF works great in the test player but not in the Flash player?

The problem I have specifically is any _root references in the loaded SWF (calling mehods in the original Timeline) does not work in the Flash player, but works just fine in the Test Player.

Thanks

Continuous MP3 Player - Based On MP3 Player Tutorial 2
A simple question but i CANT FIGURE IT OUT

so, with the first tutorial, the songs play continously throughout the list.

But the 2nd tutorial for the mp3player doesnt do that. It just stops playing after the first song.

is there anyway we can make it continous, playing all the songs in the list and still have the button controls on it?

Flash Player 10 Killed My Video Player
Hi Everyone,

I am new to this forum, but love all of the very valuable information that is available here on gotoAndLearn. I am hoping to get a solution for a couple of problems that have arisen in an application that I'm developing.

I am the developer for the web site at http://www.quired.com. I have a few different issues going on with my content. I just updated my flash player to version 10.0.12.36 yesterday. The update completely screwed up my application. The site runs off of a CMS that is built with PHP/MySQL. There are 3 Flash components: the Menu, the MediaSelector, and the MediaPlayer.

I will preface this by saying that in the past I had experienced problems with embedding multiple swfs in the same page with swfObject and AC_RunActiveContent. My solution to this was to embed the MediaSelector and MediaPlayer into individual .html or dynamic PHP pages and then use an iFrame and Javascript to load these into the main page as necessary. The idea is that the when the user clicks the menu, a Javascript is called that reloads the MediaSelector with thumbnails for videos, images, and audio clips that are linked to the page. When a user clicks a thumbnail from MediaSelector the MediaPlayer loads in with the clip that was clicked and the group of clips that the item is in. Now the user can continue to browse the site while still viewing or listening to the media in the group.

Before the update, I had experienced issues on a couple of older computers with older browser version and figured that the issue was more with the Javascripts that get called from within the swfs. The problem was basically that when the user clicked a thumb the player didn't update. Originally, we sent the user to a completely different page to view the media. The only changes that I made to the MediaSelector was the URLRequest in a navigateToURL().

My code changed from:

public function loadMedia(Event:MouseEvent):void{
var url:String;
var window:String;
//make sure it is a media item
if(Event.currentTarget.type_id < 4){
//if it isn't an image load the media player otherwise load the image with Javascript
if(Event.currentTarget.type_id != 3){
url = "../../../MediaPlayer/index.php?id="+Event.currentTarget.id+"&pageID="+requestID;
}else{
url = "Javascript: loadImageViewer('"+Event.currentTarget.id+"');";
}
window = "_parent";
}else{
url = "Javascript: loadBookInfo('"+Event.currentTarget.id+"');";
window = "_parent";
}
navigateToURL(new URLRequest(url), window);
}

To:
public function loadMedia(Event:MouseEvent):void{
var url:String;
var window:String;
//make sure it is a media item
if(Event.currentTarget.type_id < 4){
//if it isn't an image load the media player otherwise load the image with Javascript
if(Event.currentTarget.type_id != 3){
url = "Javascript: loadMediaPlayer('"+Event.currentTarget.id+"');";
}else{
url = "Javascript: loadImageViewer('"+Event.currentTarget.id+"');";
}
window = "_parent";
}else{
url = "Javascript: loadBookInfo('"+Event.currentTarget.id+"');";
window = "_parent";
}
navigateToURL(new URLRequest(url), window);
}

So basically only one line changed to call a Javascript instead of a URL. This worked fine in most updated browsers so I didn't think that there was an issue in the swf, but in the Javascript. I started to test the functionality in Safari and when I clicked the MediaSelector the swf disappeared and nothing happened. Also, my MediaPlayer wouldn't load in via the IFrame. I was thinking that this was an IFrame issue with Safari, but couldn't really find any information on it. I next tried to embed the swfs directly into the page using swfObject 2.1 and couldn't get them to work. I could right click in the area where they should be and it would tell me the Flash Object was loaded, but the swfs didn't show up. So, I then thought that possibly my Flash player wasn't up to date in Safari and downloaded and installed the update for Safari and Firefox. This didn't fix any of the issues that I was having with the swfs, but it did cause some new problems:

1) Videos in the MediaPlayer play, but are not visible. The audio is audible and the progress bar updates, but I don't get any image. I used the Video class to build this player. The progress bar autohides unless you hover over where it nests. In IE, it never comes into the screen when watching a video now. It does for audio though.
2)When playing an audio clip, I used the Bitmap Class to draw a waveform and add some filters, but now that I've updated the Flash Player the wave only shows up when the audio is paused or loading.

These issues are consistent in IE, Firefox, and Safari so it must be an issue with the new Flash Player. Somebody please help me figure out what to do about this. We are going to make a launch on the website next week and I can't have it breaking when people start updating their Flash Players.

Is there any way to force the player to run in a Flash 9 compliant mode? Sorry to write a book here, but I think that an understanding of how the app works will help in finding a solution.

Flash Player Or Shockwave Player
Hi I reformated my computer so i had to reinstall the flash player. I went to my site and a lot of things that are flash were missing so i downloaded the shockwave player and everything worked. What is the difference in the two players? I really thought that shockwave was more for games and stuff. So i was just wondering if you have to have both players to view my site properly. Thanks

Code For Experts ? Player 6 To Player 7
hi, i got this code from one of you but it didn't work for player 7, my movie must work on player 7 but this code doesn't. anybody knows which is the problem?? i guess its about terminology.

thanx




here is the code:
....................................
_root.attachMovie("ln", "line0", 0, {num:5, weight:35, elastic:0.700000, st:_root.s, en:_root.e});
_root.s.onPress = _root.e.onPress=startDrag;
_root.s.onRelease = _root.e.onRelease=stopDrag;

...............................................


#initclip
LineClass = function () {};
p =LineClass.prototype=new MovieClip();
p.onLoad = function() {
this.arrMC = [];
this.arrMC.push(this.st);
var i = 1;
while (i<this.num-1) {
this.arrMC.push({n:i++, auri:this});
}
this.arrMC.push(this.en);
ASSetPropFlags(this, null, 7, 1);
};
//
p.update = function() {
var y = (this.auri.arrMC[this.n-1]._y+this.auri.arrMC[this.n+1]._y+this.auri.weight)/2;
var x = (this.auri.arrMC[this.n-1]._x+this.auri.arrMC[this.n+1]._x)/2;
this._x += this.sx=(this.sx+(x-this._x)/5)*this.auri.elastic;
this._y += this.sy=(this.sy+(y-this._y)/5)*this.auri.elastic;
};
p.onEnterFrame = function() {
this.clear();
this.lineStyle(3, 0x333333, 100);
for (var i = 1; i<this.arrMC.length-1; i++) {
this.update.apply(this.arrMC[i]);
}
var e, s = this.arrMC[0];
this.moveTo(s._x, s._y);
for (var i = 1; i<this.arrMC.length; i++) {
s = this.arrMC[i-1];
e = this.arrMC[i];
var mx = (s._x+e._x)/2;
var my = (s._y+e._y)/2;
this.curveTo(s._x, s._y, mx, my);
}
this.lineTo(e._x, e._y);
};
delete p;
Object.registerClass("ln", LineClass);
#endinitclip

.................................................. ....

Actionscript Flash Player 6 Vs Player 7
Hi

I have this head numbing problem and was wandering if someone can help me ... I have a flash file which has some XML css which works for some reason only when exported as flash 7 player ...
but then some of my other code wont work under player 7 (works in player 6 actionsript 1 or 2 export settings)

here is the code so if someone can work it out tenx (it's a custom component like a button that moves around on hit)
(paramaters for this components are set to
friction = 0.8;ratio = 0.2; maxDistance = 1.4

onClipEvent (load) {
defaultX = _x;
defaultY = _y;
newXpos = defaultX;
newYpos = defaultY;
_root.cross._x = defaultX;
_root.cross._y = defaultY;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
xDifference = _root._xmouse - defaultX;
yDifference = _root._ymouse - defaultY;
newXpos = (_root._xmouse - (xDifference / maxDistance));
newYpos = (_root._ymouse - (yDifference / maxDistance));
} else {
newXpos = defaultX;
newYpos = defaultY;
}
newX = (newX * friction) + ((newXpos - _x) * ratio);
newY = (newY * friction) + ((newYpos - _y) * ratio);
_x += newX;
_y += newY;
}

Flash Player 6 To Work In Player 7.0
I have a xml menu created in flash mx 2004 'AS 2.0' and while it seems to work fine in flash player 6.0 I need o get it working in flash player 7.0.

The main problem when it plays in Flash player 7.0 is that my positions for my created textfields which act as my buttons are all palced at different _x position, where they should all butt up against each other in a horizontal line placed at dfferent _xpositions depending on the length of each individual text position. as i said it all seems to work fine in flash player 6.0 but not in 7.0. I think its something to do with my TextFormat but not too sure can anyone help me please as this is becoming a nightmare!!


Code:
menu_fmt = new TextFormat("menu_font", 10, 0x000000, false, false, false, "", "", "center", 0, 0, 0, 18);
GenerateMenu = function (container, name, x, y, depth, node_xml) {
var curr_node;
var curr_item;
var curr_menu = container.createEmptyMovieClip(name, depth);
for (var i = 0; i<node_xml.childNodes.length; i++) {
// movieclip for each menu item
curr_item = curr_menu.attachMovie("menuitem_mc", "item"+(i+1)+"_mc", i);
// item properties assigned from XML
curr_node = node_xml.childNodes[i];
curr_item.action = curr_node.attributes.action;
curr_item.variables = curr_node.attributes.variables;
curr_item.createTextField("name_txt", 2000, curr_menu["item"+(i+1(i-1))+"_mc"].name_txt._width+curr_menu["item"+(i+1(i-1))+"_mc"].name_txt._x, 0, curr_item.name_txt._width=curr_item.name_txt.textWidth+20, 16), curr_item.name_txt.setNewTextFormat(menu_fmt), curr_item.name_txt.selectable=false, curr_item.name_txt.embedFonts = true, curr_item.name_txt.text=curr_node.attributes.name;
curr_menu["item"+(i+1(i-1))+"_mc"].name_txt._x
boxlength = curr_item.name_txt.textWidth+20;
curr_item.name_txt._width = boxlength;
btn_mc = curr_item.attachMovie("background", "bkgd"+(i+1)+"_mc", this.getNextHighestDepth(), {_x:i*50, _y:0});
btn_mc._x = curr_item.name_txt._x;
btn_mc._width = boxlength-1;
curr_item._y = 14;
curr_menu._y = 20;
curr_item._x = 10;
curr_item.trackAsMenu = true;
if (node_xml.childNodes[i].nodeName == "menu") {
// open a submenu
curr_item.node_xml = curr_node;
curr_item.onRollOver = curr_item.onDragOver=function () {
//var x = 10;
//var y = this._y+5;
trace(btn_mc);
GenerateMenu(curr_menu, "submenu_mc", x, y, 1000, this.node_xml);
var col = new Color(this);col.setRGB(0xcc9966);
};
} else {
curr_item.onRollOver = curr_item.onDragOver=function () {
curr_menu.submenu_mc.removeMovieClip();
var col = new Color(this);col.setRGB(0xcc9966);
};
}
curr_item.onRollOut = curr_item.onDragOut=function () {
var col = new Color(this);col.setTransform({ra:100, rb:0, ga:100, gb:0, ba:100, bb:0});
}
// any item, menu opening or not can have actions
curr_item.onRelease = function() {
Actions[this.action](this.variables);
CloseSubmenus();
};
}
// end for loop
};
// create the main menu, this will be constantly visible
CreateMainMenu = function (x, y, depth, menu_xml) {
// generate a menu list
GenerateMenu(this, "mainmenu_mc", x, y, depth, menu_xml.firstChild);
// close only submenus if visible durring a mouseup
// this main menu (mainmenu_mc) will remain
mainmenu_mc.onMouseUp = function() {
if (mainmenu_mc.submenu_mc && !mainmenu_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
CloseSubmenus();
}
};
};
// closes all submenus by removing the submenu_mc
// in the main menu (if it exists)
CloseSubmenus = function () {
mainmenu_mc.submenu_mc.removeMovieClip();
};
// This actions object handles methods for actions
// defined by the XML called when a menu item is pressed
Actions = Object();
//loads swf specified in xml doc into level1
Actions.loadswf = function(swfFile) {
loadMovieNum(swfFile, "1");
};
// load XML, when done, run CreateMainMenu to interpret it
menu_xml = new XML();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function(ok) {
// create main menu after successful loading of XML
if (ok) {
CreateMainMenu(0, 0, 0, this);
message_txt.text = "message area";
} else {
message_txt.text = "error: XML not successfully loaded";
}
};
// load first XML menu
menu_xml.load("scripts/menu1.xml");

[F8] Player 8 Text Disappears In Player 7...
Hey Fellas...

I've received feedback that the text on a recently finished site of mine doesn't display on some computers.....i've tracked the problem down to Flash Player 7 not liking "Anti-alias for Readability" text, with sites published for Player 8.

Adobe seems to recommend re-publishing the .swf for Player 7, but this forces all the text to "Anti-alias for Animation" and looks wanky......

So people.....what's the standard way around this ??

What did the Flash Designers of old, do before Player 8 ??

Cheers
Jimmy

AS2 Working In Flash Player 6 But Not Player 7+
I downloaded this nice little effect and it was in AS1, and had Flash Player 6 publish settings, so i set the publish settings to AS2, and it still worked fine with Player 6 settings. BUT when i publish in Player 7 or higher, using either AS1 or AS2 settings it will not work. And i need it working in Player 8. (or if you dont have flash 8, then Player 7 would be ok 'cause it should still work in 8)

The coding is a little long and this isn't all of it but i think the problem lies somewhere in the code below, so could someone have a look through it and see if there are any incompatibilities with Flash7/8?...

code: #initclip
// constructor
function WordClass() {
// do nothing to initialize
this.tfw.autoSize=true;
this._alpha=0;
this.onEnterFrame = this.fadeIn;
}
// allow ParticleClass to inherit MovieClip properties
WordClass.prototype = new MovieClip();
// instance methods
WordClass.prototype.fadeIn = function() {
if (this._alpha<100) {
this._alpha+=10;
} else {
delete this.onEnterFrame;
}
}
WordClass.prototype.sizeTo = function(sizeX, sizeY) {
// size self to sizeX and sizeY
};
WordClass.prototype.getWidth = function() {
return Number(this.tfw.textWidth*this._xscale/100);
};
WordClass.prototype.getHeight = function() {
return Number(24*this._yscale/100);
};
WordClass.prototype.reportSize = function() {
trace(this._name+" size: "+this.tfw.textWidth+", "+this.tfw.textHeight);
};
WordClass.prototype.setWord = function(s) {
this.txtWord = s;
};
// function fitInto()
// - fit somewhere into the region and recursively call fillregion on extra spaces
WordClass.prototype.fitInto = function(x0, y0, x1, y1, d) {
// region width and height
var rWidth = x1-x0;
var rHeight = y1-y0;
var rOrientation = rHeight/rWidth;
// word object width and height
var wWidth = this.getWidth();
var wHeight = this.getHeight();
var wOrientation = wHeight/wWidth;
if (rWidth<10) {
var percent = 100;
} else {
var percent = random(40)+10;
}
var dWidth = percent/100*rWidth;
var scale = dWidth/wWidth;
this._xscale *= scale;
this._yscale *= scale;

if (this.getHeight()>rHeight) {
// recalculate width to fit height
scale=rHeight/this.getHeight();
this._xscale*=scale;
this._yscale*=scale;
}

if (random(2)) {
// place left
rx0 = x0+this.getWidth();
rx1 = x1;
this._x = x0;
if (random(2)) {
// place top
this._y = y0;
// fill region to right
this._parent.fillRegionRequest(rx0, y0, rx1, y0+this.getHeight(), d);
this._parent.fillRegionRequest(x0, y0+this.getHeight(), x1, y1, d);
} else {
// place bottom
this._y = y1-this.getHeight();
// fill region to right
this._parent.fillRegionRequest(rx0, y1-this.getHeight(), rx1, y1, d);
this._parent.fillRegionRequest(x0, y0, x1, y1-this.getHeight(), d);
}
} else {
// place right
rx0 = x0;
rx1 = x1-this.getWidth();
this._x = x1-this.getWidth();
if (random(2)) {
// place top
this._y = y0;
// fill region to left
this._parent.fillRegionRequest(x0, y0, rx1, y0+this.getHeight(), d);
this._parent.fillRegionRequest(x0, y0+this.getHeight(), x1, y1, d);
} else {
// place bottom
this._y = y1-this.getHeight();
// fill region to left
this._parent.fillRegionRequest(x0, y1-this.getHeight(), rx1, y1, d);
this._parent.fillRegionRequest(x0, y0, x1, y1-this.getHeight(), d);
}
}
};
// Connect the class with the linkage ID for this movie clip
Object.registerClass("mcWord", WordClass);
#endinitclip


Any help much appreciated!!

Audio Player/MP3 Player Class
Hello,

Below is my MusicPlayer class. Feel free to use it however you see fit. The sources are attached so you can see a working example. I striped my graphics since I'm so sexy at PhotoShop...

I know leaving objects in a class as public is bad karma, but I though it this case it warrants it. Notice public var sound:Sound is public. If you want to add more method/function without changing the class you can directly access the variable.

ActionScript Code:
import mx.utils.Delegate;
import com.FlashGordon.utils.TimeFormat;
class com.FlashGordon.media.MusicPlayer {
   
    public var sound:Sound;
    private var duration:Number;
    private var travelDistance:Number;
   
    //   vars used to display the current time in txt field
    private var displayTime:Boolean = false;
    private var txt:TextField;
   
    //   vars used in buttons of sound
    private var is_paused:Boolean = false;
    private var restartAt:Number;
   
    public function MusicPlayer(_duration:Number, _soundObj:MovieClip) {
        //    set the total duration of the music file in milliseconds
        //   if duration is defined
        if (_duration != undefined) {
            duration = _duration;
       
        //  if duration is not defined
        } else {
            //   make an onLoad function to get the actual duration
            sound.onLoad = function() {
                duration = sound.duration;
            };
        }
       
        //    create a sound object
        if (_soundObj != undefined) {
            sound = new Sound(_soundObj);
        } else {
            sound = new Sound();
        }
    }
   
    //     load the file to play
    public function play(file:String):Void {
        sound.loadSound(file, true);
    }
   
    //    track the progress of the song and scrub the sound postion
    public function progress(bar:MovieClip, preloader:MovieClip, scrub:MovieClip):Void {
        //    the total distance the scrub will travel. Used to set restart value
        travelDistance = bar._width;
       
        //    track the loading of the song
        preloader.onEnterFrame = Delegate.create(this, pre_onEnterFrame);
        function pre_onEnterFrame() {
            preloader._xscale = sound.getBytesLoaded()/sound.getBytesTotal()*100;
            //   once the sound object has been completely loaded
            if (sound.getBytesLoaded() == sound.getBytesTotal()) {
                delete preloader.onEnterFrame;
                preloader._visible = false;
            }
        }
       
        //    move the progress bar length
        bar.onEnterFrame = Delegate.create(this, bar_onEnterFrame);
        function bar_onEnterFrame() {
            bar._xscale = (sound.position/duration)*100;
            scrub._x = bar._x+bar._width-(scrub._width/2);
           
            if (displayTime) {
                txt.text = TimeFormat.format(sound.position/1000)+"/"+TimeFormat.format(duration/1000);
            }
        }
       
        //    set up scrubbing
        scrub.onPress = Delegate.create(this, scrub_onPress);
        function scrub_onPress() {
            sound.stop();
           
            //    set up draging for scrub
            var left:Number = bar._x-(scrub._width/2);
            var right:Number = preloader._x+preloader._width-(scrub._width/2);
            scrub.startDrag(false, left, scrub._y, right, scrub._y);
           
            //   make progressbar follow scrub
            delete bar.onEnterFrame;
            scrub.onEnterFrame = Delegate.create(this, scrub_onEnterFrame);
            function scrub_onEnterFrame() {
                bar._width = scrub._x+(scrub._width/2)-bar._x;
                //   display the current time for the scrub head
               
                if (displayTime) {
                    var percent:Number = (scrub._x+(scrub._width/2)-bar._x)/travelDistance;
                    //    Math.floor is used here instead of Math.round because
                    //    of dealing with time and not play position.
                    var restart:Number = Math.floor(percent*duration/1000);
                    txt.text = TimeFormat.format(restart)+"/"+TimeFormat.format(duration/1000);
                }
            }
        }
       
        scrub.onRelease = scrub.onReleaseOutside=Delegate.create(this, scrub_onRelease);
        function scrub_onRelease() {
            delete scrub.onEnterFrame;
            scrub.stopDrag();
           
            var percent:Number = (scrub._x+(scrub._width/2)-bar._x)/travelDistance;
            var restart:Number = Math.round(percent*duration/1000);
            sound.start(restart, 1);
            bar.onEnterFrame = Delegate.create(this, bar_onEnterFrame);
            is_paused = false;
        }
    }
   
    //    display the time of the audio file
    public function display_time(_txt:TextField):Void {
        txt = _txt;
        displayTime = true;
    }
   
    //    Control the volume
    public function scrub_volume(scrub:MovieClip, scrubOrientation:String, lowerLimit:Number, upperLimit:Number):Void {
       
        scrub.onPress = Delegate.create(this, onPress);
        function onPress() {
           
            if (scrubOrientation == "horizontal") {
                scrub.startDrag(false, lowerLimit, scrub._y, upperLimit, scrub._y);
            } else if (scrubOrientation == "vertical") {
                trace("vertical");
                scrub.startDrag(false, scrub._x, upperLimit, scrub._x, lowerLimit);
            }
           
            scrub.onEnterFrame = Delegate.create(this, onEnterFrame);
            function onEnterFrame() {
                if (scrubOrientation == "horizontal") {
                    var percent:Number = (scrub._x-lowerLimit)/(upperLimit-lowerLimit);
                } else {
                    var percent:Number = (scrub._y-lowerLimit)/(upperLimit-lowerLimit);
                }
                sound.setVolume(Math.round(percent*100));
            }
        }
       
        scrub.onRelease = Delegate.create(this, onRelease);
        function onRelease() {
            scrub.stopDrag();
            delete scrub.onEnterFrame;
        }
    }
   
    //    Set up the Play, Stop, and Pause buttons/movieclips
    public function buttons(play:Object, stop:Object, pause:Object):Void {
               
        //    play button
        //if (play != undefined) {
            play.onRelease = Delegate.create(this, play_onRelease);
            function play_onRelease() {
                if (is_paused) {
                    sound.start(restartAt, 1);
                    is_paused = false;
                } else {
                    sound.start(0, 1);
                }
            }
        //}
       
        //    stop button
        //if (stop != undefined) {
            //trace( "defined");
            stop.onRelease = Delegate.create(this, stop_onRelease);
            function stop_onRelease() {
                sound.start(0, 0);
                sound.stop();
                is_paused = false;
            }
        //}
       
        //    pause button
        //if (pause != undefined) {
            pause.onRelease = Delegate.create(this, pause_onRelease);
            function pause_onRelease() {
                if (!is_paused) {
                    is_paused = true;
                    restartAt = Math.round(sound.position/1000);
                    sound.stop();
                }
            }
        //}
    }
}

ActionScript Code:
class com.FlashGordon.utils.TimeFormat {
    //
    static function format(n:Number):String {
        var N:Number = Math.floor(n%60);
        if (!isNaN(N)) {
            if (N<10) {
                return Math.floor(n/60)+":0"+N;
            }
            return Math.floor(n/60)+":"+N;
        } else {
            return "0:00";
        }
    }
   
}

ActionScript Code:
stop();
import com.FlashGordon.media.MusicPlayer;

var player:MusicPlayer = new MusicPlayer(132781);
player.play("mp3s/con alma.mp3");
player.progress(progressBar_mc, preloaderBar_mc, scrub_mc);
player.display_time(time_txt);
player.scrub_volume(volScrub_mc, "horizontal", 30, 100);
player.buttons(play_mc, stop_mc, pause_mc);

Here is my only question:
Why does this not work:

ActionScript Code:
public function buttons(play:Object, stop:Object, pause:Object):Void {
               
        //    play button
        if (play != undefined) { // I CAN'T DO THIS
            play.onRelease = Delegate.create(this, play_onRelease);
            function play_onRelease() {
                if (is_paused) {
                    sound.start(restartAt, 1);
                    is_paused = false;
                } else {
                    sound.start(0, 1);
                }
            }
        }

IE Inline Player Is Faster Then Player?
Hello everybody
I've met one strange thing in AS3
swf played in IE7 ( player version is 9,0,124,0 ) uses 1-3% CPU
and same swf played in FlashPlayer ( version 9,0,115,0) uses 10-15% CPU

Can anybody tell the reason?! : )))

Video Player For Flash Player 7
Hello all,

I haven't worked much with video in Flash so any tips appreciated. I created a small swf that streams an flv in Flash 8 and used the FLVPlayback Component. Problem is that Player 8 just isn't very wide yet so I'd like to make this Player 7 compatible. Anyone have pointers to a player component or AS that I can trake apart and make work? Thanks!

Flash Player Installed, But Every Site Flash Player Required For Asks To Install Not Working At All
Hi all, wondering if someone would be kind enough to help me, PLEASE lol
Flash player asks to be installed everytime I go onto any site that requires it, I have installed it, it advises it has been sucessfully installed but when I go back to the page it asks again! Have had this problem for ages and have tried eveything I can think of! at witts end and customer service wont help as its a free product.
Any help would be greatfully appreciated.
Sarah ;-)

How To Make The "Update Player" Dialog Appear In Flash Player?
I can see that the player has a built-in update feature, which looks like a dialog that updates the player.. Looks like this feat is available even already in player 7..

However I can't seem to find how to invoke it... Anyone knows?

Thanks.

Flash Player 6 Code Doesn't Work In Flash Player 7 Or Grater
Hi flashers,

I think some of you know this page http://www.levitated.net
There you can download open source scripts that are quite cool. When I publish on of those codes with the flash player 7 or grater, they doesn't work anymore. Does anyone know why?

thanks
-Tukinu

If A Movie Is Made For Flash Player 6, Will It Work On Flash Player 5?
I doubt this, but I made an web application using MX features and some of my users use solaris/linux/other strange OS and there is no Flash Player 6 for it. Do I have no choice but to stop using Flash MX features?

Old Version Of Flash Player And Location Of Flash Player In The Computer?
Hello forum!

I want to test the update process of my site but already have the latest version of flash player. So I have two problems:

-the first one is that I can't find older versions (fp6 or fp7) on the internet

-the other one is that (don't smile) I can't manage to uninstall the latest version of flash player from my computer! I unistalled all flash player programs in the control panel of windows XP, I don't find flash player in the "program files" folder, however flash player is always working!!

Code Works For Flash Player 6 Settings But Not For Flash Player 8...
Hi,

I'm pretty new to Action script and I have a problem here that I can't seem to figure out.

I have this Action Script Code which is attached to a simple movieclip, and it all works IF the general settings are set for Flash Player 6.

It does not work for Flash Player 7 or above, which is probably because this is Actions Script 1 Code...

I attached the .fla file and also here's the code:


Code:
onClipEvent (load) {
accel =0;
rate = 0.05;
trace(_y)
_root.ykoord=0;
}

onClipEvent(enterFrame) {
y=y*accel+(_root.ykoord-_y) * rate;
_y+=y;
if(Math.abs(_root.ykoord-_y)<1) { _y=_root.ykoord; }

}
Do I need to change the code ?

I wanna publish in Action Script 2 for either Flash player 8 or 9.

Thanx for your help in advance !!!

Mike

Tsunami Works Fine With Flash 5 Player But Not With Flash 6 Player
I downloaded this tsunami from a user on this forum. It works fine when I publish it in Flash 5 player format, but NOT when I publish it in Flash 6 player format.

Can anybody tell me which part of the actionscript needs modified?

Thanks.

Ian

Code Works For Flash Player 6 Settings But Not For Flash Player 8...
Hi,

I'm pretty new to Action script and I have a problem here that I can't seem to figure out.

I have this Action Script Code which is attached to a simple movieclip, and it all works IF the general settings are set for Flash Player 6.

It does not work for Flash Player 7 or above, which is probably because this is Actions Script 1 Code...

I attached the .fla file and also here's the code:


Code:
onClipEvent (load) {
accel =0;
rate = 0.05;
trace(_y)
_root.ykoord=0;
}

onClipEvent(enterFrame) {
y=y*accel+(_root.ykoord-_y) * rate;
_y+=y;
if(Math.abs(_root.ykoord-_y)<1) { _y=_root.ykoord; }

}
Do I need to change the code ?

I wanna publish in Action Script 2 for either Flash player 8 or 9.

Thanx for your help in advance !!!

Mike

Publishing In Flash Player 6 Works. Flash Player 8 Doesn't.
I'm building a small quiz application in Flash 8. I started out targeting Flash Player 6 but have now decided that I need some of the features only available in Flash 8. When I try publishing to Flash 8 I get some weird behavior.

There aren't any AS errors, but where the application worked fine for Flash 6, now it gets stuck in a loop and never actually loads.

I've tried both Actionscript 1.0 and 2.0 as I'm pretty much just working in 1.0 on this project, and neither works in Flash 8.

Are there any known issues between version 6 and 8 that might cause something like this? I read on another forum that not initializing a numeric value that you're incrementing can cause this issue, but I've checked that and all my variables are being initialized to a value first.

Tab-control With Player 6 Not Like Player 5 ? ? ?
Hi there, can anybody help me please ?

I want to have a tab-control in a little form. For this I use this code:

on (keyPress "<Tab>") {
if (Selection.getFocus() == null) {
Selection.setFocus("_level0.username");
} else if (Selection.getFocus() == "_level0.password") {
Selection.setFocus("_level0.username");
} else if (Selection.getFocus() == "_level0.username") {
Selection.setFocus("_level0.password");
}
}

Now the problem is that when I publish this in Player 6 it doesnt work but in Player 5 it does. Can anybody tell me how I can make it work in Player 6

Player 8 Versus Player 9
Someone mentioned that Player 9 handles the file upload somewhat different than Player 8 does. The problem seems to be the MIME-type. Anyone had a similar experience?

Can You Change This From Player 6 To Player 7?
for eduactional purposes only www.braingiants.com has in it's portfolio section a bounce/resize effect fla. for download.


What needs to be changed for it to work when published for player 7 as2.0.

Can you try it and if successful, let me know of any changes required in the code.

I have tried initialising the velwidth and velheight but the effect screws up.

Thanks.

Player 7 Vs. Player 6 Problems
I have a bunch of code developed that I'm integrating into a new site - some old, some new. It breaks when I publish for version 7. When I publish for version 6 all the animation moves waaaaaaay slow. See for yourselves:

Version 6
http://www.transglobalmegacorp.com/fe_dev/

Version 7
http://www.transglobalmegacorp.com/fe7/

Anyone have similar problems or know of a good resource for making the code Player 7 compliant?

Need Movie To Work In Flash 4 Player As Well As A Flash 5 Player?
I have created a movie in flash 5 which works fine in a flash 4 player. All except one scene which uses a particular action script that flash 4 doesn't seem to like.
It's an actionscript to change the visibility of a novie clip using the _visible action.

Is there any way of converting these actions in order for them to work in a flash 4 player as well as a flash 5 player?

Sound On Off, Works With Flash Player 6 But Not Flash Player 8
Hi, I'm a flash newbie and I'm just starting to get my head round flash!
I've been working on some premade templates in flash mx2004, and everything seems fine. When I import these saved flash documents into Flash 8, and then change my publishing settings to version flash player 8, (needed to use filters etc) the on off button to control my audio that plays with the scene doesn't work!
Any ideas, the action script for the on off button that works in flash mx 2004 is as follows;

on (release) {
if (_root.sto == 1) {
Soun.setVolume(100);
_root.sto = 0;
} else {
Soun.setVolume(0);
_root.sto = 1;
}
}

Thanks in advance for any help

regards Jim Curtis.

Player Controls For Swf Similar To The Flv Player Controls Component?
Is there a component that is similar to the flv component that will control playback of a swf? or can this component also be used for a swf? I tried to create a player that uses loadmovie to load a swf, which works, but when i tried to create play, pause, forward (next scene), rewind (previous scene) etc it doesnt work and the audio and playback of the animation doesnt follow the controls when i click on the buttons. t hanks

Stompclient Is Not Working For Flash Player 9 (Flash Player 9,0,124,0)
We are facing issue in STOMP client because of newly implemented restriction on flash player.(http://www.adobe.com/devnet/flashplayer/articles/flash_player9_security_update.html).


Because of this, Our STOMP client is not able to get messages from activemq.


We have tried to add socket meta files as discussed in others article but we were not able to get solutions.

We have done below stuffs.

1) Added LoadPolicy code in stompclient for getting policyfile from server running on 80 port.
2) Also set xmlSocket as load policy to get connection from stompclient to Activemq.


1) PolicyFile.xml(loading this also in STOMPClient.swf)

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
<!-- Policy file for xmlsocket://socks.example.com -->
<cross-domain-policy>
<!-- This is a master-policy file -->
<site-control permitted-cross-domain-policies="master-only"/>
<!-- Instead of setting to-ports="*",
administrators can use ranges and commas -->
<!-- This will allow access to ports 123, 456, 457, and 458 -->
<allow-access-from domain="*" to-ports="*" />
</cross-domain-policy>

2) Flash players logs(using debug version of Flash player)

Error: Request for resource at xmlsocket://192.168.1.12:61613 by requestor from http://127.0.0.1/blackwells/bid/stompclient.swf is denied due to lack of policy file permissions.
OK: Root-level SWF loaded: http://127.0.0.1/blackwells/bid/stompclient.swf
OK: Root-level SWF loaded: http://127.0.0.1/blackwells/bid/ladyguinn.swf
OK: Searching for <allow-access-from> in policy files to authorize data loading from resource at xmlsocket://192.168.1.12:61613 by requestor from http://127.0.0.1/blackwells/bid/stompclient.swf
OK: Policy file accepted: http://192.168.1.12/crossdomain.xml
Warning: Timeout on xmlsocket://192.168.1.12:61613 (at 3 seconds) while waiting for socket policy file. This should not cause any problems, but see http://www.adobe.com/go/strict_policy_files for an explanation.
Error: Request for resource at xmlsocket://192.168.1.12:61613 by requestor from http://127.0.0.1/blackwells/bid/stompclient.swf is denied due to lack of policy file permissions.
OK: Root-level SWF loaded: http://mail.google.com/a/sigmainfo.net/im/sound.swf
OK: Root-level SWF loaded: http://127.0.0.1/blackwells/bid/stompclient.swf
OK: Root-level SWF loaded: http://127.0.0.1/blackwells/bid/ladyguinn.swf
OK: Root-level SWF loaded: http://mail.google.com/a/sigmainfo.net/im/sound.swf
OK: Root-level SWF loaded: http://127.0.0.1/blackwells/bid/stompclient.swf
OK: Root-level SWF loaded: http://127.0.0.1/blackwells/bid/bill.swf
OK: Searching for <allow-access-from> in policy files to authorize data loading from resource at xmlsocket://192.168.1.12:61613 by requestor from http://127.0.0.1/blackwells/bid/stompclient.swf
OK: Policy file accepted: http://192.168.1.12/crossdomain.xml
OK: Root-level SWF loaded: http://127.0.0.1/blackwells/bid/stompclient.swf
OK: Root-level SWF loaded: http://127.0.0.1/blackwells/bid/bill.swf
OK: Searching for <allow-access-from> in policy files to authorize data loading from resource at xmlsocket://192.168.1.12:61613 by requestor from http://127.0.0.1/blackwells/bid/stompclient.swf
OK: Policy file accepted: http://192.168.1.12/crossdomain.xml
OK: Root-level SWF loaded: http://127.0.0.1/blackwells/bid/stompclient.swf
OK: Root-level SWF loaded: http://127.0.0.1/blackwells/bid/bill.swf
OK: Searching for <allow-access-from> in policy files to authorize data loading from resource at xmlsocket://192.168.1.12:61613 by requestor from http://127.0.0.1/blackwells/bid/stompclient.swf
OK: Policy file accepted: http://192.168.1.12/crossdomain.xml
Warning: Ignoring <site-control> tag in policy file from http://192.168.1.12:843/policyfile.xml. This tag is only allowed in master policy files.
Warning: Domain 192.168.1.12 does not specify a meta-policy. Applying default meta-policy 'all'. This configuration is deprecated. See http://www.adobe.com/go/strict_policy_files to fix this problem.


3) Setting below load policy files in stompclient.mxml

flash.system.Security.loadPolicyFile("

Flash Player 9 - OK, Flash Player 10 - Type Error
Hello,

I've got a clip nested in couple of others and this clip has got two frames:

FRAME 1 code:
function handleButtonAdd(event:MouseEvent):void
{
gotoAndPlay(2);
}
bAdd.addEventListener(MouseEvent.MOUSE_DOWN, handleButtonAdd);
stop();

FRAME 2 code:
function handleButtonCancel(event:MouseEvent):void
{
gotoAndPlay(1);
}
bCancel.addEventListener(MouseEvent.MOUSE_DOWN, handleButtonCancel);
stop();

When I use Flash Player 9 everything is perfectely fine, but when I switch to Flash Player 10, I get an error message (just after clicking the first, bAdd button:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at s8tour_fla::CommentsMC_3/frame2()
at flash.display::MovieClip/gotoAndPlay()
at s8tour_fla::CommentsMC_3/handleButtonAdd()

Why is it so? Any ideas?
Thanks in advance.

Copyright © 2005-08 www.BigResource.com, All rights reserved