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








What Is Causing This Error?


when i use this code
code:
on(press){

function format(n, places) {

var pow = Math.pow(10, places);

var rounded = Math.round(n*pow);

var integerStr = String(Math.floor(rounded/pow));

var decimal = rounded%pow;

var decimalStr = String(pow)+String(decimal);

return integerStr+"."+decimalStr.substr(-places);

}
trace(format(0));
}

the output trace comes out as 0.10 instead of 0.00

can anybody see why cos i cant.
no matter what i write in the trace its always out by .10 so even if i write 3.5 it will come out 3.60

why, argh!


var.




FlashKit > Flash Help > Flash ActionScript
Posted on: 03-24-2005, 08:41 AM


View Complete Forum Thread with Replies

Sponsored Links:

What Is Causing This Error?
Okay, I made a symbol in my flash movie which happens to be a "zig" fighter. I made it from taking a screenshot from zero wing and then drawing over the zig wiht the paintbrush. Now, whenever I do much of anything involving the zig fighter, flash freezes up for about 30 seconds, or it freezes up for good. All I can really do is move it; if I try to copy it or paste it or if it touches the scrollbars flash freezes. Anyone know whats causing this, or is it just my comp?

View Replies !    View Related
AHHHHH -- What Is Causing This Error?
I am getting this error when you go to my site...

http://www.lancekorsun.com/fulltest


the error is
Code:

Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
   at com.lynda.audio.mp3::SoundLoader()
   at com.lynda.audio.mp3::Mp3Player()
   at lk_fla::MainTimeline/frame5()


what does this mean?


also -- if someone could click on any 1 of the squares, then click web... do you see the two small black boxes at the bottom with "1" and "2" in it?????

thanks for the help...got some important peeps about to look at this mama-jamma
L

View Replies !    View Related
Fade Out Causing Error With Button?
Hi, I'm getting an error whenever I click on a button in my project. I have the buttons fade out to reveal text below them, and fade back when the mosue moves away. But whenever I click the buttons I get this error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.transitions::Tween/setPosition()
at fl.transitions::Tween/set position()
at fl.transitions::Tween()
at Untitled_fla::MainTimeline/fadingin3()






This is my code (sorry don't know how to embed the code on this forum!):

import flash.events.*;
import flash.display.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;

var outTween3:Tween;

button.addEventListener(MouseEvent.MOUSE_OVER, fadingout3);

function fadingout3(event:MouseEvent): void {
outTween3 = new Tween(button, "alpha", None.easeNone, 1, 0, 1, true);
}

var inTween3:Tween;

button.addEventListener(MouseEvent.MOUSE_OUT, fadingin3);

function fadingin3(event:MouseEvent): void {
inTween3 = new Tween(button, "alpha", None.easeNone, 0, 1, 1, true);

}

button.addEventListener(MouseEvent.CLICK,b1clicked );

function b1clicked(Event:MouseEvent):void{
gotoAndPlay("10");
}

stop();




Right now the code above is on a layer on the timeline, not a seperate file, and there're 3 versions of it in same layer, one for each button. The buttons DO link to the new page, but this error keeps coming up.
What would be the easiest way to fix this? I considered a if statement to stop Mouse Out when the button's clicked but I'm not great at AS and can't even think how to start it... Any help appreciated!

View Replies !    View Related
MovieClip Causing Memory Error And Crashes App
I'm working on a portfolio flash file which has been giving me some real grief. I built the basic navigation and added content and created intital swf's to test the movie w/ no difficulties.

Now something in the flash file is causing a memory error and almost always crashes the program. I've allocated 200mb+ of RAM to flash and still I crash. I'm able to open up other flash files with no trouble.

I've even built the file over from scratch and the problem continues. I'm almost afraid to try to build it again.

I think the problem is a particular movieclip which consists of 14 frames each with a jpeg or gif screenshot of some work I've done. I've managed to save off a copy of the fla without this movieclip and everything appears to be working fine. When I try to reintroduce the movieclip to the fla the memory error ocurrs.

It can be viewed at:
http://www.movablemedia.com/mmiller/

there's no preloader built as of yet. The file size is about 670K if you're interested in taking a look.

Click the "multimedia" text. Each button along the bottom references a frame in a movieclip which I've named "multimedia_mc" This is the culprit!

Not sure what to do, any suggestion would be much appreciated. Is there some limit to how many bitmaps can be included in a fla or some file size limitation? The other sections are built the same way - a movieclip w/ jpegs & gifs and they work just fine.

Any ideas?

View Replies !    View Related
OnEnterFrame In Class Causing Runtime Error
Everything works fine (so far). Unfortunately when i publish my code to a server I get the following error from the browser:
ArgumentError: Error #2004: One of the parameters is invalid.
at flash.display::Graphics/drawRect()
at voiceover::LoadSound/onEnterFrame2()

Below is the class I created which contains the references. what is causing this?

ActionScript Code:
package voiceover{
    import flash.display.Sprite;
    import flash.media.Sound;
    import flash.net.URLRequest;
    import flash.events.*;
    import flash.media.SoundChannel;
    import flash.display.MovieClip;

    public class LoadSound extends Sprite {
        private var _soundUrl:String;
        private var _mainTL:MovieClip;
        // =========================
        private var _extSound:Sound;
        private var _channel:SoundChannel;
        private var _playPauseButton:Sprite;
        private var _proBar:Sprite;
        private var _playing:Boolean = false;
        private var _position:int;

        public function LoadSound(voice:String, mainTL:MovieClip) {
            _soundUrl = voice;
            _mainTL = mainTL;
            // auto-.load
            // create sound and load it
            _extSound = new Sound(new URLRequest(_soundUrl));
            _extSound.addEventListener(Event.COMPLETE,completeHandler);
            _extSound.addEventListener(Event.ID3,id3Handler);
            _extSound.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
            _extSound.addEventListener(ProgressEvent.PROGRESS,progressHandler);
            _channel=_extSound.play();
            _playing=true;
            _mainTL.audio_control_btn.addEventListener(MouseEvent.MOUSE_UP, onPlayPause);
            _channel.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);
            addEventListener(Event.ENTER_FRAME, onEnterFrame2);
            _proBar= new Sprite();
            _mainTL.addChild(_proBar);
                    }
        public function onEnterFrame2(event:Event):void {
            var barWidth:int = 200;
            var barHeight:int = 5;

            var loaded:int = _extSound.bytesLoaded;
            var total:int = _extSound.bytesTotal;
            var length:int = _extSound.length;
            var position:int = _channel.position;


            _proBar.graphics.clear();
            _proBar.graphics.beginFill(0xF4A801);
            _proBar.graphics.drawRect(10, 10, barWidth, barHeight);
            _proBar.graphics.endFill();

            if (total > 0) {
                var percentBuffered:Number = loaded / total;
                //trace(percentBuffered);
                _proBar.graphics.beginFill(0xD39203);
                _proBar.graphics.drawRect(10, 10, barWidth * percentBuffered, barHeight);
                _proBar.graphics.endFill();

                length /= percentBuffered;

                var percentPlayed:Number = position / length;
                //trace(percentPlayed);
                _proBar.graphics.beginFill(0xFFFFFF);
                _proBar.graphics.drawRect(10, 10, barWidth * percentPlayed, barHeight);
                _proBar.graphics.endFill();
            }
        }
        public function onPlaybackComplete(event:Event) {
            trace("The sound has finished playing.");
        }
        public function onPlayPause(event:MouseEvent):void {
            if (_playing) {
                _position = _channel.position;
                trace(_position);
                _channel.stop();
            } else {
                _channel = _extSound.play(_position);
            }
            _playing=! _playing;

        }
   

    }
}

View Replies !    View Related
Preloader In Externally Loaded Swf Causing Error
I have a movie that loads swfs into a loader within and MC on the main file/stage. The code within the movie clip housing the loader is (NOTE: I worked up an simplified fruits/veggies example to work out issues, I am not a fruit/veggie expert or anything):


ActionScript Code:
stop();

var swfLoader:Loader = new Loader();
var swf:MovieClip;
var fruitReq:URLRequest = new URLRequest("fruit1.swf");
var veggieReq:URLRequest = new URLRequest("veggies1.swf");

function fruitLoad():void
{
    addChild(swfLoader);
    swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, contentLoaded);
    swfLoader.load(fruitReq);
}
function veggieLoad():void
{
    addChild(swfLoader);
    swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, contentLoaded);
    swfLoader.load(veggieReq);
}

function contentLoaded(event:Event):void
{
    event.target.removeEventListener(Event.COMPLETE, contentLoaded);
    swf=event.target.content;
}

That loads fruit1.swf and veggies1.swf into the loader based on clicks to buttons elsewhere in the project.

The fruit1.swf file (veggie one is identical) has the following code:


ActionScript Code:
stop();

this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);

function onProgress(event:ProgressEvent):void
{
    var loaded:Number = event.target.bytesLoaded;
    var total:Number = event.target.bytesTotal;
    var pct:Number = loaded/total;
    loader_mc.scaleX = pct;
    loaded_txt.text = "Loading.... " + (Math.round(pct*100)) + "%";
}

function onComplete(event:Event):void
{
    nextFrame();
}
Then there are images on other frames within them that I access with buttons in the main movie timeline.

ERROR: The first swf loaded works fine, but then if you click the other button (fruit/veggies) the following error comes up in the output window:


ActionScript Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.  at fruit1_fla::MainTimeline/onProgress()

That repeats every time either button is clicked after that.

NOTE: I tested this after removing the preloader code(and moving the frames around to remove the blank first frame) in the external swfs and it worked fine jumping back and forth between them.

I have already plugged away at this solving a series of issues to get to this point and I have the feeling this is a pretty simple fix, but I am not sure whether I should be looking in the external swf file itself or in the loader code in the main file to solve it.

Any help would be much appreciated! Let me know if you need more info/code.

View Replies !    View Related
Flash Player Causing Syntax Error
Hi there folks, I have downloaded a component using the duplicate symbol function, it works fine when published with Flash Player 7 but when I try to update it to Flash Player 8 and publish it produces this error message:

**Error** Symbol=flame, layer=Layer 1, frame=2:Line 1: ')' or ',' expected
duplicateMovieClip("mcFlame", "Flame" add index, index);

Could someone tell me how to fix this in the code as I'm not quite up to speed with Actionscript quite yet! below is the code from the keyframe:


Code:
duplicateMovieClip("mcFlame", "Flame" add index, index);

xcoord=Math.random()*10;
xStretch=Math.random()*50;
yStretch=Math.random()*100;
opacity=Math.random()*60;

setProperty("Flame" add index, _x, xcoord);
setProperty("Flame" add index, _xscale, xStretch);
setProperty("Flame" add index, _yscale, yStretch);
setProperty("Flame" add index, _alpha, opacity);

++index;
thanks so much for any help!

View Replies !    View Related
Problem With Video Scrubber Causing Error
Hi there, hopefully someone can help me work out this problem I've been having for the past two days!!

I have a built my own AS3 Flash video player and the 'scrubber' bar appears to be causing an error message when dragged too far ahead (I assume because it's dragging ahead to a part of the video which has yet to fully load).

The error message I'm getting is....


Code:
Error #2044: Unhandled NetStatusEvent:. level=error, code=NetStream.Seek.InvalidTime
at VPlayer()
My VPlayer Class (which creates the video player) code is as follows....

NOTE: to find the scrubbing code look for the comment "// Handle the scrubbing through the video playback" and you'll see that I've attempted to wrap the scrubbing code in a Try/Catch statement (which doesn't seem to work as it doesn't catch any errors so you can remove that Try/Catch statement if you feel it's not needed)


Code:
package
{
import flash.text.TextField;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.events.NetStatusEvent;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.display.StageDisplayState;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.NetStatusEvent;
import flash.events.SecurityErrorEvent;
import flash.events.AsyncErrorEvent;
import flash.media.SoundTransform;
import flash.geom.Rectangle;

public class VPlayer extends Sprite
{
private var _stream:NetStream;
private var _play:MovieClip;
private var _controls:MovieClip;
private var _video:Video;
private var _toolbar:Sprite;
private var _thumb:Sprite;
private var _track:Sprite;
private var _scrubbing:Boolean;
private var _playbackTime:TextField;
private var _duration:uint;
private var _TotalDuration;
private var _SoundTransform:SoundTransform = new SoundTransform();
private var _TextFormat:TextFormat = new TextFormat();

public function VPlayer()
{
_controls = new Controls();
_play = new Play();
_play.buttonMode = true;
_play.addEventListener(MouseEvent.CLICK, function(){
_stream.play("Video.flv");
removeChild(_play);
addChild(_controls);
addChild(_thumb);
addChild(_track);
addChild(_playbackTime);
_controls.bFullScreen.addEventListener(MouseEvent.CLICK, toggleFullScreen);
_controls.bMuteSound.addEventListener(MouseEvent.CLICK, toggleSound);
_controls.bPlayPause.addEventListener(MouseEvent.CLICK, togglePlayback);
_controls.bPlayPause.buttonMode = true;
_thumb.addEventListener(MouseEvent.MOUSE_DOWN, oMouseDown);
_thumb.addEventListener(MouseEvent.MOUSE_UP, oMouseUp);
_thumb.buttonMode = true;
})

_video = new Video(419, 235);
_playbackTime = new TextField();
_playbackTime.x = 155;
_playbackTime.y = 217;
_playbackTime.autoSize = TextFieldAutoSize.LEFT;
_duration = 0;

var connection:NetConnection = new NetConnection();
connection.connect(null);
connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_stream = new NetStream(connection);

var client:Object = new Object();
client.onMetaData = onMetaData;

_stream.client = client;
_stream.bufferTime = 10;
_video.attachNetStream(_stream);

_track = new Sprite();
_track.graphics.lineStyle();
_track.graphics.drawRect(0, -2.5, 100, 5);

_thumb = new Sprite();
_thumb.graphics.lineStyle();
_thumb.graphics.beginFill(0xCC0000);
_thumb.graphics.drawRect(36, 221, 11, 11);
_thumb.graphics.endFill();

addChild(_video);
addChild(_play);

addEventListener(Event.ENTER_FRAME, oEnterFrame);
_stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
}

private function toggleControls(e:MouseEvent):void
{
_controls.gotoAndPlay(2);
}

private function toggleFullScreen(e:MouseEvent):void
{
stage.displayState = StageDisplayState.FULL_SCREEN;
}

private function toggleSound(e:MouseEvent):void
{
switch(_SoundTransform.volume)
{
case 0:
_controls.bMuteSound.alpha = 1;
_SoundTransform.volume = 1;
break;

case 1:
_controls.bMuteSound.alpha = 0.3;
_SoundTransform.volume = 0;
break;
}

_stream.soundTransform = _SoundTransform;
}

private function togglePlayback(e:MouseEvent):void
{
switch(_controls.bPlayPause.currentFrame)
{
case 1:
_controls.bPlayPause.gotoAndStop(2);
break;

case 2:
_controls.bPlayPause.gotoAndStop(1);
break;
}

_stream.togglePause();
}

private function onMetaData(data:Object):void
{
_duration = data.duration;

// GET THE HOURS
var Hours = Math.floor(_duration / 3600);

// GET THE MINUTES
var Minutes = Math.floor((_duration - 3600 * Hours) / 60);

// GET THE SECONDS
var Seconds = (_duration - 3600 * Hours - 60 * Minutes)

_TotalDuration = /*String(Hours) + ":" +*/ String(Minutes) + ":" + String(Seconds);
}

private function oEnterFrame(event:Event):void
{
if(_duration > 0 && _stream.time > 0)
{
_playbackTime.defaultTextFormat = _TextFormat;
_TextFormat.color = 0xCC0000;
_TextFormat.font = "Arial";
_TextFormat.bold = true;
_playbackTime.setTextFormat(_TextFormat);
_playbackTime.text = generateTime(_stream.time) + " / " + _TotalDuration;
}

// Handle the scrubbing through the video playback
if(_duration > 0)
{
if(_scrubbing)
{
try
{
_stream.seek(_duration * _thumb.x / _track.width);
}
catch(err)
{
_playbackTime.text = err;
}
}
else
{
try
{
_thumb.x = _stream.time / _duration * _track.width;
}
catch(err)
{
_playbackTime.text = err;
}
}
}
}

function generateTime(nCurrentTime:Number):String
{
var nMinutes:String = (Math.floor(nCurrentTime / 60) < 10 ? "0" : "") + Math.floor(nCurrentTime / 60);
var nSeconds:String = (Math.floor(nCurrentTime % 60) < 10 ? "0" : "") + Math.floor(nCurrentTime % 60);

//Set Result
var sResult:String = nMinutes + ":" + nSeconds;

//Return Value
return sResult;
}

private function oMouseDown(e:MouseEvent):void
{
_scrubbing = true;
var rectangle:Rectangle = new Rectangle(0, 0, _track.width, 0);
_thumb.startDrag(false, rectangle);
}

private function oMouseUp(e:MouseEvent):void
{
_scrubbing = false;
_thumb.stopDrag();
}

public function netStatusHandler(e:NetStatusEvent):void
{
switch (e.info.code)
{
case "NetStream.Seek.InvalidTime":
trace("You have seeked too far ahead, the video hasn't fully loaded yet");
_playbackTime.text = "You have seeked too far ahead, the video hasn't fully loaded yet"
break;
case "NetStream.Play.StreamNotFound":
trace("Unable to locate video");
_playbackTime.text = "Unable to locate video"
break;
}
}

private function securityErrorHandler(e:SecurityErrorEvent):void
{
trace("securityErrorHandler: " + e);
}

private function asyncErrorHandler(e:AsyncErrorEvent):void
{
trace("asyncErrorHandler; " + e);
}
}
}
Many thanks for any help!

Kind regards,
M.

View Replies !    View Related
No Syntax Error, But Causing Flash Player To Run Slowly. Why?
This is a script I did today to draw 6 rectangular boxes down the side of the screen. Its from a program in Fresh Flash (new design ideas with Flash MX), I've changed it to my needs. There are no syntax errors but it is causing the Flash Player to run slowly. I am using Flash MX. Can anyone help?

All it involves is this script in the first frame of the movie.

MovieClip.prototype.drawSquare = function(xpos,ypos,wdth,lgth,fcolour){
x = xpos;
y = ypos;
w = wdth;
l = lgth;
this.lineStyle(1,0,100);
this.beginFill(fcolour,50);
this.moveTo(x,y);
this.lineTo(x,y+l);
this.lineTo(x+w,y+l);
this.lineTo(x+w,y);
this.lineTo(x,y);
this.endFill();
}

//create squares and add events

for(i=0;i=150;i+=30){
_root.createEmptyMovieClip('mc'+i,i);
with(_root['mc'+i]){
drawSquare(100,i,10,30,0xFFFFFF);
}

//the rollover
_root["mc"+i].onRollOver = function(){
_root.createEmptyMovieClip("rol",1000);
rol.drawSquare(100,this._y,10,30,0xFFFFCC);
}

//the rollout
_root["mc"+i].onRollOut = function(){
rol.clear();
}

//the release
_root["mc"+i].onRelease = function(){
_root.texttarget = i*30;
}
}


Thanks for any help

Graeme
www.reebox.co.uk

View Replies !    View Related
Script Causing Flash Player To Run Slowly Error
Hello,
I'm externally loading some pretty large swfs (4MB - 5MB) into my main swf using a preloader. as the swfs are loading i'm getting a pop-up window saying
"A script in this movie is causing Adobe Flash Player 9 to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?"
if i click "no" everything continues to run fine. if i click "yes" my movie freezes in the middle of loading with the progress bar stopped at whatever percentage has already loaded.
what is causing this pop up window and how do i get rid of it? thanks.
-michael

here is the page causing the issue
http://epicuredigital.com/tower/tower_website.html

here is a picture of the error (it happens in firefox and safari)
http://epicuredigital.com/tower/flash_error.png

here is the actionscript i'm using on frame 1

stop();

MovieClip.prototype.fadeIn = function() {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 10;
} else {
delete this.onEnterFrame;
}
};
};
bar._visible = false;
border._visible = false;
var empty = this.createEmptyMovieClip("container", "100");
empty._x = 0;
empty._y = 0;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._alpha = 0;
bar._visible = true;
border._visible = true;
pText._visible = true;

};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
bar._width = (lBytes/tBytes)*100;
pText.text = "% "+Math.round((lBytes/tBytes)*100);
container.gotoAndStop(1);

};
preload.onLoadComplete = function(targetMC) {
container.fadeIn();
border._visible = false;
bar._visible = false;
dText._visible = false;
trace(targetMC+" finished");
container.gotoAndPlay(1);
};
//default image
my_mc.loadClip("tower_swfs/welcome_1.swf", "container");
//buttons
button1.onPress = function() {
gotoAndStop("1");
my_mc.loadClip("tower_swfs/welcome_1.swf", "container");

};
button2.onPress = function() {
gotoAndStop("5");
my_mc.loadClip("tower_swfs/tower_salad.swf", "container");

};
button3.onPress = function() {
gotoAndStop("10");
my_mc.loadClip("tower_swfs/tower_wifi.swf", "container");
};

View Replies !    View Related
Help Flash Element Causing Browser Compatibility Error
Hello -

Can anyone possibly help with this problem??

I have a site with a Flash movie, a Google Adsense banner, and a regular banner ad. For some reason, the images fail on IE but work on Firefox. I have checked the code and it all looks ok.

Any advice on this would be much apprecaited!!!

the site is : http://www.dotfart.com (well, I never said this was important!)

thanks, Dave!!!

View Replies !    View Related
'Script Causing Flash Play To Run Slow' Error Message
I'm getting the 'Script causing Flash Player to run slow' Error Message is there any way to stop this? The script is fine albeit that it has 12 arrays containing upto or over 10,000 values each on which it has to do some heavy work on. If i ignore the message the script enentually executes and does what it is supposed to do. I suspect flash is at it's limit. I have tried spreading the calculations across frames which did help a little, but i can only spread them so thin. Is it time for director? or does anyone have any other ideas? Thanks in advance, Firthy.

Ps If youre wondering why have such large arrays, I've got flash to record volumes of it's 8 sound channels along with some event sounds against time, so a user can record a track which appears to have 12 channels. Everything is fine with the recording and playback, it just has gets very slow when I try and post the variables to a database (it does do it but i get message as above)

View Replies !    View Related
Pong Game: GotoAndStop Causing Error #1009: Cannot Access A Property Or Method Of A Null Object Reference.
I'm building a pong game as a way of learning Flash and actionscript 3. Almost have it done.

The game consists of 4 frames: begin, play, win, and lose.

The code for begin works fine and the code for win and lose is the same so I will concentrate on the code for play and lose.

The actual game code in play works fine. Collision detection, score tracking, player paddle movement, AI paddle movment, etc. But there is one problem.

Problem: After the player or the computer gets to 5 points the game is supposed to go to the win or lose frame. I use gotoAndStop for this: gotoAndStop("lose"). This is where I get the "Error #1009: Cannot access a property or method of a null object reference."

From what I can tell it has to do with the gotoAndStop statements that take the player to the win or lose frame. I say this because if I add an End button with an event listener and function call in place of either gotoAndStop statement the End button works properly. It takes me to the win or lose frame (depending on which I target) without an error. But only putting gotoAndStop("frame") in the if statement gives me the error. I want the program to automatically go to the win or lose frame based on the score. I do not want the user to have to click anything.

The code I'm using for the play and lose frames is below.

Any thoughts?







Attach Code

//PLAY FRAME CODE

var playerScore:int = 0;
var computerScore:int = 0;
var relY:int;
var relPerc:Number;
var newDy:Number;

init();

function init(){
//turns off mouse pointer
Mouse.hide();

//gives ball initial direction
ball.dx = 15;
ball.dy = 6;

//Sets the speed of the computer's paddle. Higher speed equals a better
//opponent.
computerPaddle.speed = 8;
}

playerPaddle.addEventListener(Event.ENTER_FRAME, fnPlayerEnterFrame);
computerPaddle.addEventListener(Event.ENTER_FRAME, fnComputerEnterFrame);
ball.addEventListener(Event.ENTER_FRAME, fnBallEnterFrame);

function fnPlayerEnterFrame(event:Event):void{
//Player's paddle follows mouse
playerPaddle.y = stage.mouseY - (playerPaddle.height / 2);
}

function fnComputerEnterFrame(event:Event):void{
//Move the computer's paddle relative to the ball and difficulty
//setting (computerPaddle.speed)
if ((ball.y + (ball.height/2)) < (computerPaddle.y + (computerPaddle.height/2))){
computerPaddle.dy = -computerPaddle.speed;
} else {
computerPaddle.dy = computerPaddle.speed;
}
computerPaddle.y += computerPaddle.dy;
}

function fnBallEnterFrame(event:Event):void{
//move the ball
ball.move();

//check if it hit the top or bottom
ball.checkBoundaries();

//check if it hit a paddle
ball.checkPaddles();
}


ball.move = function(){
ball.x += ball.dx;
ball.y += ball.dy;
}

ball.checkBoundaries = function(){
if (ball.y < 0){
ball.dy = -ball.dy;
}
if (ball.y > stage.stageHeight){
ball.dy = -ball.dy;
}
if (ball.x < 0){
computerScore++;
computerScoreField.text = computerScore.toString();
if (computerScore >= 5){
gotoAndStop("lose");
}

ball.x = computerPaddle.x-50;
ball.y = computerPaddle.y + (computerPaddle.height / 2);

ball.dy = 0;
}

if (ball.x > stage.stageWidth){
playerScore++;
playerScoreField.text = playerScore.toString();

if (playerScore >= 5){
gotoAndStop("win");
}

ball.x = playerPaddle.x + 50;
ball.y = playerPaddle.y + (playerPaddle.height / 2);
ball.dy = 0;

}
}

ball.checkPaddles = function(){
if (ball.hitTestObject(playerPaddle)){
ball.dx = -ball.dx;
ball.dy = getDy(playerPaddle);
}
if (ball.hitTestObject(computerPaddle)){
ball.dx = -ball.dx;
ball.dy = getDy(computerPaddle);
}
}

function getDy(paddle){
relY = (ball.y + (ball.height/2)) - (paddle.y + (paddle.height/2));

relPerc = relY / paddle.height;

newDy = relPerc * 30;

return newDy;
}



//LOSE FRAME CODE

Mouse.show();

btnPlay.addEventListener(MouseEvent.CLICK, fnPlay);

View Replies !    View Related
Flash Error "script Causing Flashplayer9 To Run Slowly"
my browser (FFire, IE7) is hanging whenever i run this Flash site the second time around and subsequent times. The AS around the point/frame where the movie freezes is the code I've attached...

i didn't write the code; i'm just guessing that this might be a problem since it's right at the frame where the movie stalls - it actually calls another external page or two along with images from folders, so i'm not sure what or where the issues is...

does this look like a problem?







Attach Code

pages.gotoAndStop(_root.link);
if (pages._currentframe == 1) {
k = 0;
while (_root['cat_'+k]) {
i = 0;
while (_root["cat_"+k+"_pic_"+i]) {
pages.gallery.gallery.preview["image"+i].removeMovieClip();
i++;
}
k++;
}
pages.gallery.gallery.gotoAndPlay(4);
}

View Replies !    View Related
Error: " A Script In This Movie Is Causing Flash Player To Run Slowly.....unres..."
I just installed the charting components and tried to make a bar graph. It is giving me this Error: " a script in this movie is causing Flash Player to run slowly...unresponsive..."
I installed the components again but same result. Does someone know what the problem could be ? I then removed the script and just copied the default bar chart from the components on the stage (without adding any script) and tried to test the movie but same error. Could someone please help me out ?
Thanks.

View Replies !    View Related
Error Msg-"A Script In This Movie Is Causing Macromedia Flash Player 7 To Run Slowly"
Hello, all.

I am building an application around a prebuilt application that I found here at Macromedia:
"Flash MX Professional 2004 Data Integration Using Microsoft Active Server Pages (ASP)" -
http://www.macromedia.com/devnet/mx/...ro_asp_02.html.
I am using this prebuilt app on 14 "SCREENS" so that each time a user navigates to one of the 14 pages, a new query is run.

I am receiving about 12-14 Error boxes that say:

[A script in this movie is causing Macromedia Flash Player 7 to run slowly. If it continues to run your computer may become unresponsive. Do you want to abort the script?]

I can not figure out why!!! I am pretty new to Flash... Do I need a pre loader on this movie, or is there something in the initial code.?

The TUTORIAL says this about the application:
"The application starts when the user loads the Flash movie in his or her browser. The first thing that happens is that the Contacts_xmlcon instance of the XMLConnector component will trigger, calling ASP and getting the initial table of contacts in return. This component passes the returned array of contacts to a DataSet component, which sends it to a DataGrid and other Flash UI components"

--I HAVE ATTCAHED THE INITIAL ACTION SCRIPT CODE---

StatusHandler = new Object();
StatusHandler.status = function(stat) {
if (stat.code != "StatusChange") {
Info_txt.text = "Connector STATUS - " + stat.target._name + "/" + stat.code + "/" + stat.data.faultcode + "/" + stat.data.faultstring;
}
}
Contacts_xmlcon.addEventListener("status",StatusHa ndler);
SaveContacts_xmlcon.addEventListener("status",Stat usHandler);

View Replies !    View Related
Error Msg-"A Script In This Movie Is Causing Macromedia Flash Player 7 To Run Slowly"
Hello, all.

I am building an application around a prebuilt application that I found here at Macromedia:
"Flash MX Professional 2004 Data Integration Using Microsoft Active Server Pages (ASP)" -
http://www.macromedia.com/devnet/mx/...ro_asp_02.html.
I am using this prebuilt app on 14 "SCREENS" so that each time a user navigates to one of the 14 pages, a new query is run.

I am receiving about 12-14 Error boxes that say:

[A script in this movie is causing Macromedia Flash Player 7 to run slowly. If it continues to run your computer may become unresponsive. Do you want to abort the script?]

I can not figure out why!!! I am pretty new to Flash... Do I need a pre loader on this movie, or is there something in the initial code.?

The TUTORIAL says this about the application:
"The application starts when the user loads the Flash movie in his or her browser. The first thing that happens is that the Contacts_xmlcon instance of the XMLConnector component will trigger, calling ASP and getting the initial table of contacts in return. This component passes the returned array of contacts to a DataSet component, which sends it to a DataGrid and other Flash UI components"

--I HAVE ATTCAHED THE INITIAL ACTION SCRIPT CODE---

StatusHandler = new Object();
StatusHandler.status = function(stat) {
if (stat.code != "StatusChange") {
Info_txt.text = "Connector STATUS - " + stat.target._name + "/" + stat.code + "/" + stat.data.faultcode + "/" + stat.data.faultstring;
}
}
Contacts_xmlcon.addEventListener("status",StatusHa ndler);
SaveContacts_xmlcon.addEventListener("status",Stat usHandler);

View Replies !    View Related
**Error** TempInit : Line 1, Column 5 : [Compiler] Error #1084: Syntax Error: Expecti
Hi,

I'm trying to convert my AS2 project to AS3. I got rid of all errors but one :

**Error** tempInit : Line 1, Column 5 : [Compiler] Error #1084: Syntax error: expecting identifier before 45.
var 45:MovieClip;

I got no idea what tempInit is, and no where do I declare a variable called 45...

After searching the web for hours I am tired and thus asking for your help.

Thank you,

View Replies !    View Related
Error #2044: Unhandled IoError:. Text=Error #2032: Stream Error. Cannot Be Caught
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: file:///C|/LocalWorkspace/Simulation%20Platform/sim/assets/conversations/14/Maria/NPC_104.MRK


Hi all, I'm getting this error, and I damn well know why. Its because I'm trying to load a file that doesn't exist. But the thing is, I'm wrapping the code in a try catch, and I'm still getting the error. Also, I'm being told that the error is on this line:


ActionScript Code:
var loader:URLLoader = new URLLoader();

I need to do it this way because i know that some of the files I'm trying to load do not yet exist.

But what could possibly be wrong with this line? And either way, it should be caught by the try, catch. So, whats the problem?



ActionScript Code:
try {
        var loader:URLLoader = new URLLoader();
        loader.addEventListener(Event.COMPLETE, completeHandler);
       
            loader.load(new URLRequest(_filename));
        } catch (error:Error) {
            trace("DATA: loadAnimData(): Error loading lip synch data.");
        }

View Replies !    View Related
Error Message ? Error #2044: Unhandled IoError:. Text=Error #2032:
Can anyone give me any advise on why in safari 3 and firefox i am getting this error:

Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://www.nayomusic.com/music/1.mp3

URL: http://www.nayomusic.com/home

The error occurs when a any link is clicked on from within homepage

If anyone has got any idea why this error occurring then this would be much appreciated

Thanks

Jon

View Replies !    View Related
Error #2044: Unhandled IoError:. Text=Error #2032: Stream Error.
I'm trying to open a new centred window with a javascript in AS3, the code is working in the browser but when tested in flash I got this error:
"Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: javascript:void(newWin=window.open('http://www.actionscript.org','newWindow','width=500,heigh t=500,left=590,top=262.5'))"

This is the code that I'm using.

Code:
var resX:int = flash.system.Capabilities.screenResolutionX
var resY:int = flash.system.Capabilities.screenResolutionY

var winW:int = 500
var winH:int = 500

var winX:int = (resX/2) - (winW/2)
var winY:int = (resY/2) - (winY/2)

var jsCode:String = "javascript:void(newWin=window.open('http://www.actionscript.org'," + "'newWindow','width=" +winW + ",height=" + winH +"," +"left=" + winX +",top=" + (winY-winY/2) + "'))";


var urlLoader:URLLoader = new URLLoader()
urlLoader.load(new URLRequest(jsCode))
What is wrong becouse if you test a compiled .swf with this code in the browser a centred window opens.???

View Replies !    View Related
Error #2044: Unhandled IOErrorEvent:. Text=Error #2032: Stream Error.
Hi all,

I created a simple streaming mp3 player and it works perfectly fine locally, but when i upload it i get the below error. I only get this error if i go to refresh or leave the page. The flash itself loads but does not function.

Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at player.audio.actions::SoundLoader()
at player.audio.actions::Mp3Player()
at main_fla::MainTimeline/frame1()

The code that includes the url is below:


Code:
var songs:Array = ["believe.mp3", "newSong.mp3"];
the swf file is saved in the same directory as the mp3 files but i am still getting the stream error.

I have tried changing the path to a full url with no luck.

What is strange is that if i load the mp3 directly via the URL i have uploaded it to, and then go back to the player, it works. but only in firefox and IE. safari for windows does not work either way.

the class i used to load the url is below:


Code:
public function SoundLoader(songs:Array, player:Mp3Player)
{
songList = songs;
musicPlayer = player;
soundReq = new URLRequest(songList[songIndex]);
loader.load(soundReq);
loader.addEventListener(Event.COMPLETE, songLoaded);


}

Does anyone have any ideas? It's driving me nuts!

Much appreciated!

View Replies !    View Related
Error #2044: Unhandled IOErrorEvent:. Text=Error #2032: Stream Error
This is my code. (Even though this error occours, it doesnt affect my file in anyway, except when you look at it on a website a little error comes up (click it away) and everything is still exactly fine)

ANyway its annoying me now, so iw ont to get rid of it:

Heres my code:


ActionScript Code:
var s:Sound = new Sound(new URLRequest("Galactik_Football.mp3"));
s.play(0, 1000);

var ba:ByteArray = new ByteArray();

addEventListener(Event.ENTER_FRAME, loop);

var bmd:BitmapData = new BitmapData(700, 400, true, 0x000000);
var bm:Bitmap = new Bitmap(bmd);
addChild(bm);

var sp:Sprite = new Sprite();
addChild(sp);

var blur:BlurFilter = new BlurFilter(10,10,3);

var colorMatrix:ColorMatrixFilter = new ColorMatrixFilter([
    1, 0, 0, 0, 0,
     0, 1, 0, 0, 0,
     0, 0, 2, 0, 0,
     0, 0, 0, 0.99, 0
]);

function loop(e:Event):void
{
    sp.graphics.clear();
    sp.graphics.lineStyle(2, 0xFFFFFF);
    sp.graphics.moveTo(-1, 150);
    SoundMixer.computeSpectrum(ba);
    for(var i:uint=0; i<256; i++)
    {
        var num:Number = -ba.readFloat()*200 + 150;
        sp.graphics.lineTo(i*2.75, num*1.3);
    }
    bmd.draw(sp);
    bmd.applyFilter(bmd,bmd.rect,new Point(),blur);
    bmd.applyFilter(bmd,bmd.rect,new Point(),colorMatrix);
    bmd.scroll(3,0);
}

View Replies !    View Related
Error #2044: Unhandled IOErrorEvent:. Text=Error #2032: Stream Error
Hi, i've written out some code that doesn't seem to want to work and im not too sure why. Basically i've imported a sound file in to flash and i have two buttons to play and pause. I've set up a custom class thing in the linkage properties of the sound file.


ActionScript Code:
var audio:Sound = new Sound(new URLRequest("Phil.mp3"));
var audioChannel:SoundChannel = audio.play();

pauseBtn.addEventListener(MouseEvent.MOUSE_UP, pauseSound);
playBtn.addEventListener(MouseEvent.MOUSE_UP, playSound);

function pauseSound(e:MouseEvent):void
{
    audioChannel.stop();
}

function playSound(e:MouseEvent):void
{
    audioChannel = audio.play(audioChannel.position);
}

When i try and run the code, it comes up with this message

"Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at Untitled_fla::MainTimeline/Untitled_fla::frame1()"

if anyone can give any assistance as to why this doesn't work - it'd be super.

View Replies !    View Related
Error #2044 Unhandled IoError:. Text=Error #2032: Stream Error. URL:
Hey Everyone
Can someone explain this to me. I am using Go Live CS2 to upload my files and I only get the Error (below) when I upload my files to the internet. I have one FLA file and inside the FLA I have a request to a .xml doc to load in my images. The images appear when I test the file in FLash, and when I test my published html page. But as soon as I upload the files to the internet I get the error below. The flash file runs correctly but the images do not appear.
My page www.ii-designs.com/maybe then click on the works tab and where the bottom gray lines is where the images are suppose to be

I get this error
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: file:///private/var/tmp/folders.501/TemporaryItems/AdapterTemp/Server_1/public_html/maybe/data/photoImages.xml at _photoImages/frame1()
please help this is driving me crazy
Thanks
Ryan

View Replies !    View Related
Error #2044: Unhandled IOErrorEvent:. Text=Error #2038: File I/O Error.
Gday guys,

im making a lil flex app to upload images for guys on my forum.. problem is, it works fine in opera and firefox im told now also, but in internet explorer.. im getting this error..

"Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.
at uploadd$iinit()
at _uploadd_mx_managers_SystemManager/create()
at mx.managers::SystemManager/::initializeTopLevelWindow()
at mx.managers::SystemManager/::docFrameHandler()"

this is my code? its str8 off the adobe site itself. from what i gather, its the way the scipt is handling the error itself? its terminating itself bcos of it.?


Code:
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import flash.events.DataEvent;


public var fileRef:FileReference = new FileReference();

public function upload():void {
// listen for the file selected event
// listen for the upload complete event
fileRef.addEventListener(Event.SELECT, selectHandler);
fileRef.addEventListener(Event.COMPLETE, completeHandler);
fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA , uploadCompleteHandler);


// browse for the file to upload
// when user selects a file the select handler is called
try {
var imageTypes:FileFilter = new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg; *.jpeg; *.gif; *.png");
var allTypes:Array = new Array(imageTypes);
var success:Boolean = fileRef.browse(allTypes);

}
catch(error:IOErrorEvent) {
trace("IOErrorEvent catch: " + error);

}



}

// when a file is selected you upload the file to the upload script on the server
public function selectHandler(event:Event):void {
var request:URLRequest = new URLRequest("upload.php")
try {
// upload file
fileRef.upload(request);
textarea1.text = "uploading " + fileRef.name + "...";
}

catch(error:IOErrorEvent) {
trace("IOErrorEvent catch: " + error);

}



}

// dispatched when file has been given to the server script. does not receive a response from the server
public function completeHandler(event:Event):void {
trace("file uploaded complete");


}

// dispatched when file has been uploaded to the server script and a response is returned from the server
// event.data contains the response returned by your server script
public function uploadCompleteHandler(event:DataEvent):void {
trace("uploaded... response from server:
" + String(event.data));
textarea1.text += event.data as String;
}

]]>
</mx:Script>
Also id like to be able to directly have the link traced into the message box itself, so people dont have to copy n paste.. is there an easy solution in the php code?

Heres the link, the upload is on the left of the main reply box.. heres a direct link to the forum, use

User: Ryann
Pass: temp

http://www.weride.net/ThrashedMinis/phpBB2/

, and press a reply or new topic sumwere to view it.. thanks for anyone taking a look..

Ryann.

View Replies !    View Related
Error #2044: Unhandled IoError:. Text=Error #2032: Stream Error.
Hi all I really need help. What I understand from this error is that Flash can't find the file which is a bit of confusing, because if I copy the code to other file it works. Is there something with that I have 2 urloaders in the code I load 2 different type of files one txt and one xml? This is the structure of my xml file
Code:
<xml>
<name>Some Name</name>
<address>Some Address</address>
<option>Some Option</option>
<other>Some Other</other>
<bank>Some Bank</bank>
<iban>12300 0000 0000 0000 0000 00</iban>
<bic>25500000</bic>
</xml>
Please help

View Replies !    View Related
Error #2044: Unhandled IoError:. Text=Error #2032: Stream Error.?
I get this message "Error #2044: Unhandled ioError:. text=Error #2032: Stream Error." when I try to get parameters from a .asmx doc that looks like this:

.net:

flUser.Movie = string.Format(@"{3}?UID={0}&strUserName={1}&strWsUrl......


In as3:

var oParam:Object = LoaderInfo(root.loaderInfo).parameters;
strUserID = oParam.UID;

I get the parameters written into a textfield but it doesn't work? Anyone know what's wrong? Could it have something to do with Sandbox issue? Do a miss an "import.display"?

View Replies !    View Related
What Is Causing This?
check what happens to this png image when i try to rotate it a bit

http://www.sixofour.org/test-site/

it looks so wierd, and its definatly not "smooth"


can someone help me with this?

should i use actionscript to let the image move?

thx in advance

View Replies !    View Related
Anyone Know What's Causing This Problem
Ok, I'll try to explain my situation.
I have site with muliple scenes. I loaded a movie in one of the scene. The movie does not play until a button is clicked. This works however, if the user were to hit the button to go back to the previous page ( which I want them to have the option of doing) the movie continues to play
ON TOP of the new page....

WHY! is this happening. How can I tell it that when the button is click to STOP playing the current scene/movie and for it to not be ON TOP of the new page.

Any help deeply appreciated.

If this is unclear please email and I'll try to explain it clearer.

Thanks

View Replies !    View Related
[F8] LineTo Causing Serious Lag?
I have some simple code that creates a movie clip and draws a line in it to represent a bullet in my game. Code works great except for the fact that as more and more bulletes get shot, the slower and slower my game gets. I would think that the obvious cause for this problem would be if movie clips were building up and up and up. But I remove the past movie clip and I know they are being removed. If I comment out this code my game runs at a blazing speed so I KNOW that its this code that is causing the problem. I just cant see it. Maybe flash's garbage collector is getting backed up or something.


Code:
unloadMovie(lineTarget);
_root.createEmptyMovieClip("line"+_global.dn_weaponlines,_global.dn_weaponlines);
lineTarget = _root["line"+_global.dn_weaponlines];
_root["line"+_global.dn_weaponlines].lineStyle(.75, 0xFFFFFF, 50);
_root["line"+_global.dn_weaponlines].moveTo(lastCoordX, lastCoordY);
_root["line"+_global.dn_weaponlines].lineTo(targeted._x, targeted._y);
_global.dn_weaponlines++;


EDIT : so it seems I was using the incorrect method/function to remove the movie clip from existance. removeMovieClip fixed my prob

View Replies !    View Related
[F8] What In The World Is Causing This?
I have a website that works perfectly in Firefox(Pc), but Is messed up on IE(pc), Firefox(mac), and Safari(mac).

Each of the buttons on this site has exactly the same layout, timing and actionscript, but Photography, 3D and Film/Video Sections, the drop down window drops down twice and doesn't show the content. I have no idea.

Any thoughts would be greatly appreciated!

-roger

http://thinkmonkeymedia.com/monkey/

Actionscript on each movieclip button:

Code:
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
if (_root._currentframe == "1") {
this.nextFrame();
}
} else {
this.gotoAndStop(1);
}
}
ActionScript on frame 1 of main timeline:

Code:
stop();
_root.photography_mc.onRelease = function() {
if (_root._currentframe == "1") {
_root.gotoAndPlay(3);
_root.onEnterFrame = function() {
if (_root._currentframe == "16") {
delete (_root.onEnterFrame);
stop();
_root.holder.loadMovie("photography.swf");
}
};
}
};
_root.websitedesign_mc.onRelease = function() {
if (_root._currentframe == "1") {
_root.gotoAndPlay(3);
_root.onEnterFrame = function() {
if (_root._currentframe == "16") {
delete (_root.onEnterFrame);
stop();
_root.holder.loadMovie("websitedesign.swf");
}
};
}
};
_root.about_mc.onRelease = function() {
if (_root._currentframe == "1") {
_root.gotoAndPlay(3);
_root.onEnterFrame = function() {
if (_root._currentframe == "16") {
delete (_root.onEnterFrame);
stop();
_root.holder.loadMovie("about.swf");
}
};
}
};
_root.threed_mc.onRelease = function() {
if (_root._currentframe == "1") {
_root.gotoAndPlay(3);
_root.onEnterFrame = function() {
if (_root._currentframe == "16") {
delete (_root.onEnterFrame);
stop();
_root.holder.loadMovie("3d.swf");
}
};
}
};
_root.filmvideo_mc.onRelease = function() {
if (_root._currentframe == "1") {
_root.gotoAndPlay(3);
_root.onEnterFrame = function() {
if (_root._currentframe == "16") {
delete (_root.onEnterFrame);
stop();
_root.holder.loadMovie("filmvideo.swf");
}
};
}
};
_root.graphicdesign_mc.onRelease = function() {
if (_root._currentframe == "1") {
_root.gotoAndPlay(3);
_root.onEnterFrame = function() {
if (_root._currentframe == "16") {
delete (_root.onEnterFrame);
stop();
_root.holder.loadMovie("graphicdesign.swf");
}
};
}
};
_root.contact_mc.onRelease = function() {
if (_root._currentframe == "1") {
_root.gotoAndPlay(3);
_root.onEnterFrame = function() {
if (_root._currentframe == "16") {
delete (_root.onEnterFrame);
stop();
_root.holder.loadMovie("contact.swf");
}
};
}
};
_root.othercompanies_mc.onRelease = function() {
if (_root._currentframe == "1") {
_root.audio_mc.gotoAndStop(4);
stopAllSounds();
getURL("http://thinkmonkeymedia.com/bobbets/", "_blank");
}
};

View Replies !    View Related
What Could Be Causing This Weirdness?
I have a flash menu/button thingy that has developed a problem.
http://www.furisdead.com/. When you click on the Tommy Lee button at the top, then try to click on the other buttons, you get nothing but Tommy Lee.

The data is called in via XML. I didn't create this, another staff member who is no longer with us did and I am no actionscript guru but am left to figure out the problem. Hence, I need your help.

Attached are both the fla and xml files

TIA!

View Replies !    View Related
I.e. Causing .swf To Act A Little Strange...
hi there,

i was wondering if anyone had experimented with the wonderful flipbook source code from iparigrafika. i've got it tweaked to just the way i would like it to be and it's fine. except....when i view the page in i.e. there's about one second of delay before the book opens up the page, and in that second of delay it's strange because the inside page shows through. am i making sense?

it only happens in i.e. and not in firefox, netscape or opera. has anyone had this glitch? oh yeah, it does not happen when i view the .swf page only without the frame of the html page. wierd!

http://www.adriennemariavrettos.com/denise/index1.html

thanks in advance for any input!

View Replies !    View Related
Key Down Causing Problems
This is driving me mad so I hope someone can help me out.

I've been working on a game and it's nearly complete barring a couple of features and finalising grahics etc.

http://www.booyahonline.com/booyahblaster.htm

You control your character with the arrow keys and hold down the space bar to uild up power in the rock you throw at the creatures. Once the power is high enough you can release the space bar and throw a rock.

Once you get to level 2 (the last one at the moment) the creatures start to attack you with green spit (nice).

If the character you control is not holding a rock (space bar up) the collision casuses a sequence to be initiated where a different frame of the character mc is displayed.

However if a rock is being held (space bar down) the sequence will not happen. All the scoring scripts run and the game plays perfectly well but the character will not move frames.

I've tried removing the key listener on the space bar when the colision takes place but nothing seems to work out. The key listener runs a function which moves the character to the frame where he holds the rock so I though that would be the answer. Not so.

I'm not going to post the code here because it would simply be toooooo big but I was wondering if anyone else has experienced difficulties when using key controls and if they found any good ways to get round situations like this.

Thanks for any help and advice shockers

View Replies !    View Related
MPEG’s Are Causing A Problem
MPEG’s are causing a problem

I like many others have a swf movie and within this movie I have things that load in, however its not as easy as using DreamWeaver etc, for example to load files all I do is make a button and link it to a jpeg or mpeg etc and it plays in its own default media player etc. Thus I don’t have to worry about embedding files in swf.

My question is: can I load files from within swf. That are not swf. GetURL etc??????

Thanks for help if any

View Replies !    View Related
Dense Actionscripting Causing Lag?
I'm a bit of a novice at learning how to nest the bits of code and when to import clips from the library and how all of that saves time/space/speed...

So, I have 15 movie clips.

Each one of these movie clips have *massive* amounts of the exact same code on them. I basically built everything bass ackwards and painted myself into a corner with this one.

My question is: due to all of this massive chugging at the actionscript level that's happening on my 400mhz, will the content its actually moving (they are variously sized images) be a factor in how all of the code "synchronizes"?

Again its all the exact same code, but if i'm using it to move around a 7k image is that going to make that code unsynch from the code that is moving the 70k image?

I'm totally screwed if it does, I'm getting weird synch problems where the same function is not executing the same way with each pass... makes it a bit of a useless function

View Replies !    View Related
Little XML Problem, Causing Big Headache
I'm having a b*tch of a time trying to convert the number of times an XML node appears into a solid number. All the XML imports fine & the attributes are recognizable, but I can't get a correct count

here's the XML structure:

index
content index="1"
item/
item/
/content
content index ="2"
item/
item/
/content
/index

Not exactly difficult. What I'm trying to do here is tally the number of "content" nodes & come up with that total number, (two in this case) & place it in a variable.

Can anyone please help me?

View Replies !    View Related
Loadmovie Causing Issues
I'm trying to load a movie called a_1-2_early.swf into the movie 1-2.swf

a_1-2_early.swf loads in an external mp3 and plays it along with a few audio controls (play/stop/etc)
I use this code to load in the audio:
<blockquote>
this.onLoad = function() {
_root.sounda = new Sound(this);
_root.sounda.loadSound("audio/1.2_early.mp3", false);
}
</blockquote>
This movie works fine on it's own but will not load the audio (nor give me any error messages) once I try to load it from 1-2.swf

1-2.swf loads in the movie with this code:
<blockquote>
on (release) {
loadMovie("flash/a_1-2_early.swf", "_root.audio");
}
</blockquote>

1-2.swf is displayed in an html file. Here's what my directory structure looks like:
root
- 1-2.html
- [audio]
- 1.2_early.mp3
- [flash]
- 1-2.swf
- a_1-2_early.swf

Any ideas on why the audio isn't loading once I try to load it from another movie? Is there any way that I can see where it's trying to load the audio from? I get no error messages when I run the program, all I get is the first frame of the preloader contained in a_1-2_early.swf but it doesn't show the percentage, just the text 'loading'

View Replies !    View Related
Preloader Causing Problems....
hey all...

i used a preloader tutorial from this site (http://www.flashkit.com/tutorials/Ac...-924/index.php)....the preload works fine, except for one problem: any movie clip sitting on the root level won't play when activated....excuse my level of newness, i'm not great with actionscript at all...anyway, when i mouse over a button that is supposed to activate a movieclip, nothing happens, and i get an output message that says: "Error: A 'with' action failed because the specified object did not exist."

When i test the .swf that the preloader is loading on its own, it works fine....it only goes wacky when it is preloaded....any help would be greatly appreciated...

View Replies !    View Related
Script Causing Unresponsiveness
Christ, I have no freakin clue what the problem is, when I preview it in flash, it works smooth and everything. I upload it and look at it, and a script is causing unresponsiveness. I've tinkered with it a couple times, doesn't help. I believe it's when the swf is fully loaded, cause I have a preloader, it goes to 96%, about to hit 100, than freezes, and says do you want to abort script? Can someone please help?

http://members.aol.com/kidfloa/preview.html (to view it on a web page)

http://members.aol.com/kidfloa/word.fla


oh, and it might be the html coding for it because if I view the swf itself ( http://members.aol.com/kidfloa/word.swf ) it works fine and everything, does anyone knows the cause of this problem?

View Replies !    View Related
Components Causing MX To Crash?
I found an old post regarding this issue, but there were no replies to it. I'm using Flash MX on OS X and I have only fiddled with it a little bit since I got it. I did play around with components once or twice. Today I've tried to insert a component into a movie and Flash crashes immediately. I've tried several times to do it and every time it crashes. The only thing that I can think of that is different from before is I downloaded some other components (from the Macromedia site) and installed them.

Has anyone else had this crashing problem? I was unable to find on Macromedia any updates or much information about MX crashing using components.

View Replies !    View Related
While Statement Causing Problem
Ive got a "while" loop in my script , and when i run it in Testmode(Test Movie) inside of Flash it gives me a problem
in the line of:
"The script is causing the Flash player to run slowly, this may cause your computer to stop responding, do you want to abort the script?"

the same happens when i publish my file unto the web and run it through the browser.

Although when i run it in Debug mode inside of Flash it runs correctly , when I step through the script , and the script is working correctly.

What may cause this?
is something in my script or something with my "while" statement

here is my script below:
>>>

while (_parent.getBytesLoaded() < _parent.getBytesTotal()) {
if (_global.contentframes >= _global.nextsegment){
_global.nextsegment = (_global.contentframes+_global.segmentdelay);
_root.preloader.gotoAndStop(_root.preloader._curre ntframe + 1);
}
}
_parent.gotoAndPlay(2);

<<<
I'll greatly appreciate any help
thanks

meister

View Replies !    View Related
Pixelated .swf Causing Bewilderment
Like many sites, I have an opening html page letting the user know that they need the flash plugin etc. I then have the swf open in a new window set at 800x600 pixels. The swf is told to open at 800x600 also. All of this works fine except that the jpg's in my swf look pixelated. What I find odd about this is that the dimensions of my flash document are 990x742! When I make the swf open into a new window at 990x742, it looks perfect, no pixelation at all, but this is a larger window then my client wants. So my question is, why does scaling DOWN the size of the swf make this pixelation occur? and how can I fix it without using a larger window? Thank you! If you would like to view the site go to www.digineering.biz

View Replies !    View Related
New Level Causing Issues
I am loading movies into several levels on my site. If I have a movie on level 4 for example, I want the buttons on the lower levels (3,2,1,0) not to be active. Is their a script that will do this? or will i have to target all those buttons seperatly to make them inactive.

Thanks

View Replies !    View Related
FOR Loop Causing NaN Or Undefined
Here's the code:

on (press) {
for (var i = 0; i<=4; i++) {
k = random(3);
pp = new Array();
for (var j = 0; j<=k; j++) {
pp[j] = dofunction();
}
this["text"+i] = pp.join(" / ");
trace("returned text "+i+" = "+this["text"+i]);
_global.dofunction = function() {
return "some text";
};
}
}


Here's the output:

returned text 0 = undefined / undefined / undefined
returned text 1 = some text / some text / some text
returned text 2 = some text / some text
returned text 3 = some text / some text / some text
returned text 4 = some text / some text


Why is the first return an Undefined? Sometimes (in different versions of the script) it returns NaN for the first run through but then is fine. I have tried to call "i" as a number intially : i = Number(i); and I have tried to incriment it at the start of the script : i++; but nothing seems to help.
Thanks in advance crew!

Aaron

View Replies !    View Related
Components Causing Crash
I'm trying to stream a video using the new video components in flash mx 2004 pro.

i'm calling the .flv inside the component inspector but when i publish or view the swf it plays for 2 seconds and then crashes explorer or flash.

what can be doing this? I'm on a 2.7 ghz pc with loads of ram.

View Replies !    View Related
Loading Swf Into _mc Causing Problems
im using mx 2004.
within my main movie i have a target_mc that im loading external swf's into with loadMovie. If one swf is loading into that target_mc and i interupt it by trying to load a different swf into target_mc, thats where the problem starts. it stops the loading of the first swf, just as it should, but when the second swf is done loading, it starts cycling through the timeline of that 2nd swf. I of course have several stops in that timeline, it just blows by them as if their not there. There is no way to stop this cycling unless the browser is closed.
I have tried an unloadMovie before the loadMovie.
check this out at
www.manwiller.com/celebration
click on the wedding info link then before it loads, click on the lodging link and you will see it. If you have high speed, you'll need to click the second link quickly.
thanks for any help.

View Replies !    View Related
Sounds Causing Pausing
Im making a shooting game. When you collect power ups they make a sound. The ploblem is that the first time you collect a power up the game stops for a second to load the sound. Please help.

View Replies !    View Related
LoadMovie Causing A Headache
Hi,

Ive built a website for someone whereby I have the interface buttons down the left hand side of the website and on clicking them they load the relevant section on the right hand of the page.

All works fine and well for me and for 95% of people, but for some, when clicking these buttons, the .swf movies do not load! Including the guy who paid for it.

Each button simply says LoadMovie (nameofmovie.swf, 2). Everything else on the website works perfectly, all updates are read via the text files etc. Its just when it comes to load the .swfs through the menu.

The 1 person is using the AOL Browser (yes ive read all the posts about AOLs stinkiness) AND Internet Explorer. Both do exactly the same thing making me believe it isnt an AOL issue.

My question is, is there any other way to link the buttons to the .swfs (rather than loadMovie) as maybe that would be a solution. Is this a problem anyone else has? Also could it be a setting on his computer not allowing it to load? The only firewall he seems to have is the free one with AOL which is running when I tried IE. I changed IE to allow all cookies in from my website which seemed to work the first time but on reloading the browser it stopped working.

Ive literally got a headache, anyone know a solution?

View Replies !    View Related
Buttons Causing Refresh
I have some buttons on my movie that have this AS on them

on (release) {
loadMovie("casa.swf","_level0.targetMC");
}

Some of the time it works ok, but others when I click on the buttons it causes the whole main movie to refresh and play from the beginning.

please take a look..


http://www.dfwstudio.com/flash/test.html


Any ideas?? This started happening after I took the attached sound out of the _root timeline and started using a BG Sound Object to stream it externally.

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved