Keep Getting Errors
im tryin 2 make sumtin liek this
http://www.vatos-x.com/preview/tutor...sic_button.php
and everytime i add a actionscript thingy and test it out i always get this message
Code:
Statement must appear within on handler
could someone please tell me what im doin wrong?
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 07-07-2007, 08:02 AM
View Complete Forum Thread with Replies
Sponsored Links:
Solution To Dealing With Loader Errors (not URLLoader Errors)
Related post:
http://board.flashkit.com/board/showthread.php?t=738745
The biggest issue I have been having was when there was no custom portal icon. There would be a URL error thrown. After many google searches, I always ended up with error catching that worked with URLLoader imports. They didn't work for me.
As it turns out Loader imports (like picture and such) have a different way of posting errors:
code:
var loader:Loader = new Loader();
configureListeners(loader.contentLoaderInfo);
private function configureListeners(dispatcher:IEventDispatcher):vo id {
dispatcher.addEventListener(Event.COMPLETE, completeHandler);
dispatcher.addEventListener(HTTPStatusEvent.HTTP_S TATUS, httpStatusHandler);
dispatcher.addEventListener(Event.INIT, initHandler);
dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); // the one i needed
dispatcher.addEventListener(Event.OPEN, openHandler);
dispatcher.addEventListener(ProgressEvent.PROGRESS , progressHandler);
dispatcher.addEventListener(Event.UNLOAD, unLoadHandler);
}
And with this i fixed all bugs.
Thanks to every one that helped.
View Replies !
View Related
Maybe Errors ?
just find out something may not right when I reading Flash Help docs(perhaps I just got wrong conprehensions), here it is:
location:
Understanding the ActionScript Language -- About Custom Objects -- Creatiing Inheritance
suspecious points:
this line in example code:
[as]
MountainBike.roll();
[as]
it wont work(or just not work for me ?) because MountainBike is not an instance here so the result will be undefined. To fix this we could act this way:
code:
myBike = new MountainBike();
myBike.roll(); // it will work nicely because it is an instance derived from MountainBike.
any remarks ?
View Replies !
View Related
Errors?
hi people! so im very new to flash and im making my first game on it.. im using this step by step guide i found on the internet http://www.layoutgalaxy.com/html/htm...er47-page1.htm
but i changed the balloons to pandas lol ANYWAYS i was following the directions until i got to like the second page when it says to test my movie, and i did and i get this error message:
**Error** Symbol=panda move, layer=panda move, frame=2:Line 1: Clip events are permitted only for movie clip instances
onClipEvent (load) {
**Error** Symbol=panda move, layer=panda move, frame=2:Line 5: Clip events are permitted only for movie clip instances
onClipEvent (enterFrame) {
Total ActionScript Errors: 2 Reported Errors: 2
and then when i close that box and try to play the game another error box comes up that says the above, plus:
Target not found: Target="_root.pandas0" Base="_level0.instance4"
Target not found: Target="_root.pandas20" Base="_level0.instance4"
Target not found: Target="_root.pandas40" Base="_level0.instance4"
Target not found: Target="_root.pandas60" Base="_level0.instance4"
Target not found: Target="_root.pandas80" Base="_level0.instance4"
and so on and so on and the number next to 'pandas' keeps increasing by 20
so i was just wondering if its because i used pandas instead of balloons that it isnt working... or? is there somthing wrong with the code they use, or if i messed up how do i fix it? if you need more information just let me know. thanks for your help in advance.
View Replies !
View Related
Getting NaN Errors
Error opening URL "file:///Matt%20G5/Users/matt/Desktop/Work/WESCAM/WESCAM%20Flash%20Presentation/vars/fw/fwNaN.txt"
Error opening URL "file:///Matt%20G5/Users/matt/Desktop/Work/WESCAM/WESCAM%20Flash%20Presentation/aircraftimages/fwNaN.jpg"
What is the problem with these errors? Here's what I'm trying to do:
stop();
var slideInfoLV:LoadVars = new LoadVars();
slideInfoLV.load ("vars/slide_info.txt");
var curFrameNum: Number = 0;
function loadFrame() {
_level0.myAir.load("vars/fw/fw1.txt");
_level0.myCamera.load("vars/fw/fw" + curFrameNum + ".txt");
_level0.myCustomer.load("vars/fw/fw1.txt")
_level0.myImage.loadClip("aircraftimages/fw" +curFrameNum+ ".jpg",this.image);
}
loadFrame();
//next slide button
this.nextSlideBtn.onRelease = function() {
if (curFrameNum < Number (slideInfoLV.totalFrames) -1) {
curFrameNum++;
}else{
curFrameNum = 0;
}
loadFrame();
}
//
ext slide button
//previous slide button
this.prevSlideBtn.onRelease = function() {
if (curFrameNum == 0) {
curFrameNum = Number(slideInfoLV.totalFrames) - 1;
}else{
curFrameNum --;
}
loadFrame();
}
View Replies !
View Related
AS 3.0 Errors?
I learning AS3.0 for the moment but get this errors like
"1046: Type was not found or was not a compile-time constant: TweenEvent"
"1119: Access of possibly undefined property SoundTransform through a reference with static type flash.media:SoundChannel"
Codes seems to be ok.
Are there any problems reported on the latest release of the AS3.0 like this??
View Replies !
View Related
Hi All, Wat Does All These Errors Mean?
hi all, wat does all these errors mean?
i've checked thru all scenes but cant seem to find any..n my swf works...but wen bedugged, i got these outputs...
**Error** Scene=dressMeUp(MainPage-user choose either one to dress character up), layer=Layer 1, frame=1:Line 1: Statement must appear within on/onClipEvent handler
q
**Error** Scene=differenceBetweenBabiesAndCookies, layer=Layer 26, frame=1:Line 1: Statement must appear within on/onClipEvent handler
stop();
**Error** Scene=differenceBetweenBabiesAndCookies, layer=Layer 7, frame=115:Line 1: Statement must appear within on/onClipEvent handler
stop();
Total ActionScript Errors: 3 Reported Errors: 3
View Replies !
View Related
Help With Errors.
ok i have two erros which are the following:
HTML Code:
1180: Call to a possibly undefined method addFrameScript.
1180: Call to a possibly undefined method stop.
here is my .as file that is linked under the secure file name.
HTML Code:
package {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
public class secure extends Sprite {
var the_hero: Sprite = new ball();
var power:Number = 0.3;
var friction:Number = 0.95;
var xspeed:int = 0;
var yspeed:int = 0;
var up = false;
var down = false;
var left = false;
var right = false;
public function secure() {
addChild(the_hero);
the_hero.x = 250;
the_hero.y = 200;
stage.addEventListener(KeyboardEvent.KEY_DOWN, key_pressed);
stage.addEventListener(KeyboardEvent.KEY_UP, key_released);
addEventListener(Event.ENTER_FRAME, render);
}
function key_pressed(e:KeyboardEvent):void {
switch (e.keyCode) {
case Keyboard.UP :
up = true;
break;
case Keyboard.DOWN :
down = true;
break;
case Keyboard.LEFT :
left = true;
break;
case Keyboard.RIGHT :
right = true;
break;
}
}
function key_released(e:KeyboardEvent):void {
switch (e.keyCode) {
case Keyboard.UP :
up = false;
break;
case Keyboard.DOWN :
down = false;
break;
case Keyboard.LEFT :
left = false;
break;
case Keyboard.RIGHT :
right = false;
break;
}
}
private function render(e:Event):void {
if (up) {
yspeed -= power;
}
if (down) {
yspeed += power;
}
if (left) {
xspeed -= power;
}
if (right) {
xspeed += power;
}
xspeed *= friction;
yspeed *= friction;
the_hero.x += xspeed;
the_hero.y += yspeed;
}
}
}
also i have this in the first frame of my .fla named Security AS3
HTML Code:
stop();
lastly i have a movieclip named "Player!_Main@" that has the class linckage of "ball"
I provided all the info i could. Thank you to anyone who tries to help.
View Replies !
View Related
Errors
Hiya,
I posted a while back asking for some help with a hittest, I managed to fix it with some for loops...But now I'm encountering some new errors and I was hoping to get some help.
The 2 class files I have right now are:
Ball.as which defines the movement properties of the ball and what happens when it hits the sides of the stage:
ActionScript Code:
package {
//import necessary classes
import flash.display.MovieClip;
import flash.events.Event;
import flash.geom.Rectangle;
public class Ball extends MovieClip{
//horizontal speed and direction
public var speedX:int = -10;
//vertical speed and direction
public var speedY:int = -10;
//constructor
public function Ball() {
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
//called every frame
private function onEnterFrame(event:Event):void {
//move ball by appropriate amount based on the x/y speed variable
x += speedX;
y += speedY;
//get boundary rectangle for ball
var bounds:Rectangle = getBounds(parent);
// reverse horizontal direction if collided with left or right of stage
if (bounds.left < 0 || bounds.right > stage.stageWidth) {
speedX *= -1;
}
//reverse vertical direction if collision with top or bottom
if (bounds.top < 0 || bounds.bottom > stage.stageHeight) {
speedY *= -1;
}
}
}
}
And BallControl.as which randomly creates a red or blue ball every second, the number of balls on stage limited to 20. When the blue and red balls hit a green ball is created. When a blue and green ball hit, the blue ball is removed, and when a red and green hit, the green ball is removed.
ActionScript Code:
package {
//import the necessary classes
import flash.display.MovieClip;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.geom.ColorTransform;
import flash.events.Event;
public class BallControl extends MovieClip {
//total number of balls
private var ballnum: int = 0;
//declares the timer variable, used to create a new timer which handles the creation of the balls
private var timer:Timer;
//declares blue and red arrays, which will store information about the respective ball colors
private var blueArray: Array = new Array;
private var redArray: Array = new Array;
private var greenArray:Array = new Array;
//the greencreate variable, this is necessary to prevent the hittest function from creating multiple green balls upon each hit
private var greencreate: int = 0;
//constructor
public function BallControl() {
//creates and starts a new timer which will initialize the mainloop event every second
timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, mainloop);
timer.start();
stage.addEventListener(Event.ENTER_FRAME, hittest);
}
//the mainloop function which is called at each timer interval
public function mainloop(timer:TimerEvent):void {
//if the number of balls on the stage is less then 20 the function will occur
if (ballnum < 20) {
//the redball and blueball objects are instances of the Ball class
var redball:Ball = new Ball();
var blueball:Ball = new Ball();
//creates a net color transform variable, used to manipulate the color of the blue and red balls
var colourTransform:ColorTransform = new ColorTransform();
//if the number generated by math random is greated then .5
if (Math.random() > .5)
{
//set the ball's color to blue
colourTransform.color = 0x0000ff;
blueball.transform.colorTransform = colourTransform;
//place the ball in the centre of the stage
blueball.x = stage.stageWidth/2;
blueball.y = stage.stageHeight/2;
//specify random speed and direction
blueball.speedX = (Math.random() * 30) - 15;
blueball.speedY = (Math.random() * 30) - 15;
blueball.width = (Math.random() * 10) +30;
blueball.height = blueball.width;
//add the blue ball to the stage
addChild(blueball);
//adds the blue ball to the blueArray
blueArray.push(blueball);
//increases the i variable by 1
//increases the total number of balls by 1
ballnum++;
//resets the greencreate variable
greencreate = 0
}
//if the random number generated is less then .5
else if (Math.random() < .5) {
//set the ball's color to red
colourTransform.color = 0xff0000;
redball.transform.colorTransform = colourTransform;
//place it in the centre of the stage
redball.x = stage.stageWidth/2;
redball.y = stage.stageHeight/2;
//set a random speed and direction
redball.speedX = (Math.random() * 30);
redball.speedY = (Math.random() * 30);
redball.width = (Math.random() * 10) + 30;
redball.height = redball.width;
//add a red ball to the stage
addChild(redball);
//adds the red ball to the redArray
redArray.push(redball)
//increases j by 1
//increases the total number of balls by 1
ballnum ++;
//resets the greencreate variable
greencreate = 0
}
}
}
//the hittest function, which is called every frame
private function hittest (event:Event):void {
//declares the i and j variables, which are dependant on the length of the respective arrays
for (var i:int = 0; i< blueArray.length; i++)
{
for (var j:int = 0; j< redArray.length; j++)
{
//the function will only occur if both the blue and red arrays have at least 1 object, this prevents the occurrance of an error
if(blueArray.length > 0 && redArray.length > 0)
{
//if any object in the blue array hits an object in the red array
if (blueArray[i].hitTestPoint(redArray[j].x, redArray[j].y, true))
{
/* if (blueArray[i].width > redArray[j].width)
{removeChild(redArray[j])}
else if (blueArray[i].width < redArray[j].width)
{removeChild(blueArray[i])}
*/
//if the ball number is less then 20
if(ballnum < 20) {
//and if the green create variable is less then 1
if (greencreate < 1)
{
// a greenball variable is declared which is an instance of the ball class
var greenball:Ball = new Ball();
//a new colortransform called greentransform is declared, setting its value to green
var greenTransform:ColorTransform = new ColorTransform();
greenTransform.color = 0x00ff00;
greenball.transform.colorTransform = greenTransform;
//creates the new greenball at the location of the blueball which hit a redball
greenball.x= blueArray[i].x + 50;
greenball.y= blueArray[i].y + 50;
//sets a random speed
greenball.speedX = (Math.random() * 30) - 10;
greenball.speedY = (Math.random() * 30) - 10;
greenball.width = (Math.random() * 10) +30;
greenball.height = greenball.width;
//adds the greenball to the stage
addChild(greenball);
//adds the greenball to the greenArray
greenArray.push(greenball)
//increases the greencreate value by 1, so only 1 greenball is created each hit
greencreate ++;
//ballnum is increased by 1 so more then 20 balls are not created
ballnum++;
}
}
blueArray[i].speedX *= -1;
blueArray[i].speedY *= -1;
redArray[j].speedX *= -1;
redArray[j].speedY *= -1;
}
for (var k:int = 0; k< greenArray.length; k++)
{
if (blueArray[i].hitTestPoint(greenArray[k].x, greenArray[k].y, true))
{
removeChild(blueArray[i]);
ballnum--;
}
if (redArray[j].hitTestPoint(greenArray[k].x, greenArray[k].y, true))
{
removeChild(greenArray[k]);
ballnum--;
redArray[j].speedX *= -1;
redArray[j].speedY *= -1;
}
}
}
}
}
}
}
}
And finally is an .fla file which simply contains the Ball movieclip.
The problem is whenever the red and green ball hit, the green ball is removed just as I had intended, but I get an output error saying:
Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at BallControl/::hittest()
How do I modify my code to stop that error from happening? It's not affecting the movie's playback but I'd like to try prevent it.
Also, my .fla's document class is set to the BallControl class file, but when I try to initialize it through actions in the second frame of the fla (so I can have an intro screen) rather then use the document class, I get this error:
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at BallControl$iinit()
at balls_fla::MainTimeline/balls_fla::frame1()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at BallControl/mainloop()
at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
at flash.utils::Timer/flash.utils:Timer::tick()
Is it possible to stop that error or am I stuck using the document class?
Thanks in advance for any help
View Replies !
View Related
Errors
So far I've gotten three different errors while trying to open one of my Flash Documents. The first said; There is not enough memory to complete this operation.
The second said; While executing, the fallowing Java Script error (s) occured
"Exception trow in native function"
The thirdsaid; While executing, the fallowing Java Script error (s) occured
"Can not find file"
Can anyone help me.
Thanks
View Replies !
View Related
AS Errors?
hey all,
Well i've just put together a flash document, and i've included rollout buttons within it. Although when i've tested it, it works fine but i do get an error which is below:
'**Error** Scene=Scene 1, layer=gallery_btn, frame=1:Line 1: Mouse events are permitted only for button instances
on(rollOver) {
Total ActionScript Errors: 1 Reported Errors: 1
i've looked over everyting and everything seems to be ok, can anyone suggest whats worng, i've linked the document below, any help would be great thanx
http://rapidshare.com/files/185091012/index_01.fla
View Replies !
View Related
IE6 Errors With AS3
I'm getting error messages using FLVPlayer and AS3 when viewing the swf using IE6. The error messages are:
VerifyError: Error #1014: Class flash.event::FullScreenEvent could not be found.
at.fl.video::FLVPlayback$init()
also
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at doghouse_fla::MainTimeline/doghouse_fla::__setProp_my_player_Scene1_video_53()
at doghouse_fla::MailTimeline/doghouse_fla::frame53()
Can anyone help?
I have attached the actionscript from frame 53
Attach Code
import fl.video.VideoEvent;
my_player.addEventListener(VideoEvent.COMPLETE, navigate);
skip_btn.addEventListener(MouseEvent.CLICK, navigate);
function navigate(e:Event) {
trace("navigate");
my_player.stop();
gotoAndPlay(54); // Increased frame by 1 to account for the added frame up front.
}
stop();
View Replies !
View Related
Help With Errors Please
Hi, I'm building a Flash website.
I've used frames with names to contain the different 'pages' of the site. On the frame called 'SVHS1' I've built an XML mp3 player with buttons and a volume slider.
I'm having a couple of problems with this section of the site.
Firstly: when I 'test movie' and navigate to the mp3 player section it all works fine, the mp3s load correctly, the playback controls work fine, and the volume slider does what it's supposed to do. But if I've used the volume slider to adjust the volume (and only then) and then navigate to the next frame 'SVHS2' (or any frames that are later in the main timeline) I get multiple occurrences of the following error in the output pane:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
At PSPWebsite1_fla::MainTimeline/adjustVolume()
I understand (from reading other posts/help etc.) in principle what is causing this, but my knowledge of AS3 is too limited to know exactly what is wrong with my script or how to fix it.
Secondly: if I press the stop button on my mp3 player and then navigate to another frame (any frame before or after ‘SVHS1’) the site works fine, and the mp3 player works perfectly if I go to that frame again. But if I navigate to another frame without first stopping the song it continues to play even though I’m not on the mp3 player frame, and if I go back to the mp3 player before the song has finished it starts playing automatically from the beginning of the first song in the XML list again and simply doubles up the sound, which is horrible. When this happens the playback controls only affect the 2nd version (understandably).
I think this is probably quite simple to fix, assuming that I have to write some script that tells the mp3 player to stop playing if/when the user navigates away from that frame...but I don’t know how to do this.
Any help with either of the above would be much appreciated.
The attached script is for the mp3 player frame.
Attach Code
SVHeadline1.addEventListener(MouseEvent.CLICK, SVHeadline1Clicked);
SVHeadline2.addEventListener(MouseEvent.CLICK, SVHeadline2Clicked);
vargetYoutube:URLRequest = new URLRequest("http://uk.youtube.com/user/PollingStationProds");
SVHeadline3.addEventListener(MouseEvent.CLICK, SVHeadline3Clicked);
function SVHeadline1Clicked(event:MouseEvent):void
{
gotoAndPlay("SVHS1");
}
function SVHeadline2Clicked(event:MouseEvent):void
{
gotoAndPlay("SVHS2");
}
function SVHeadline3Clicked(event:MouseEvent):void
{
navigateToURL(getYoutube);
}
volume_mc.slider_mc.useHandCursor = true;
varmusicReq:URLRequest;
varmusic:Sound = new Sound();
varsc:SoundChannel;
varcurrentSound:Sound = music;
varpos:Number;
varsongPlaying:Boolean = false;
varxml:XML;
varsonglist:XMLList;
varcurrentIndex:Number = 0;
varloader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, whenLoaded);
functionwhenLoaded(e:Event):void
{
xml = new XML(e.target.data);
songlist = xml.song;
musicReq = new URLRequest(songlist[0].url);
music.load(musicReq);
sc = music.play();
title_txt.text = songlist[0].title;
artist_txt.text = songlist[0].artist;
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
}
loader.load(new URLRequest("PSPjukebox.xml"));
mp3btn_FF.addEventListener(MouseEvent.CLICK, nextSong);
mp3btn_RW.addEventListener(MouseEvent.CLICK, prevSong);
mp3btn_PAUSE.addEventListener(MouseEvent.CLICK,pauseSong);
mp3btn_STOP.addEventListener(MouseEvent.CLICK,stopSong);
functionnextSong(e:Event):void
{
if (currentIndex< (songlist.length() - 1))
{
currentIndex++;
}
else
{
currentIndex = 0;
}
varnextReq:URLRequest = new URLRequest(songlist[currentIndex].url);
varnextTitle:Sound = new Sound(nextReq);
sc.stop();
title_txt.text = songlist[currentIndex].title;
artist_txt.text = songlist[currentIndex].artist;
sc = nextTitle.play();
songPlaying = true;
currentSound = nextTitle;
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
}
functionprevSong(e:Event):void
{
if (currentIndex> 0)
{
currentIndex--;
}
else
{
currentIndex = songlist.length() - 1;
}
varnextReq:URLRequest = new URLRequest(songlist[currentIndex].url);
varprevTitle:Sound = new Sound(nextReq);
sc.stop();
title_txt.text = songlist[currentIndex].title;
artist_txt.text = songlist[currentIndex].artist;
sc = prevTitle.play();
songPlaying = true;
currentSound = prevTitle;
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
}
functionpauseSong(e:Event):void
{
pos = sc.position;
sc.stop();
songPlaying = false;
mp3btn_PLAY.addEventListener(MouseEvent.CLICK,playSong);
}
functionplaySong(e:Event):void
{
if(songPlaying == false)
{
sc = currentSound.play(pos);
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
songPlaying = true;
mp3btn_PLAY.removeEventListener(MouseEvent.CLICK,playSong);
}
}
functionstopSong(e:Event):void
{
sc.stop();
pos = 0;
songPlaying = false;
mp3btn_PLAY.addEventListener(MouseEvent.CLICK,playSong);
}
//----VOLUME----//
vardragging:Boolean = false;
varrectangle:Rectangle = new Rectangle(0,0,75,0);
volume_mc.slider_mc.addEventListener(MouseEvent.MOUSE_DOWN,dragIt);
volume_mc.slider_mc.addEventListener(MouseEvent.MOUSE_UP,dropIt);
stage.addEventListener(MouseEvent.MOUSE_UP,dropIt);
functiondragIt(e:Event):void
{
volume_mc.slider_mc.startDrag(false,rectangle);
dragging = true;
volume_mc.slider_mc.addEventListener(Event.ENTER_FRAME, adjustVolume);
}
functiondropIt(e:Event):void
{
if (dragging)
{
volume_mc.slider_mc.stopDrag();
dragging = false;
}
}
functionadjustVolume(e:Event):void
{
varvol:Number = volume_mc.slider_mc.x / 75;
varst:SoundTransform = new SoundTransform(vol);
if (sc != null)
{
sc.soundTransform = st;
}
}
View Replies !
View Related
Errors.
im making a flash based email system on my website. ive been using this tutorial
theses are the errors i have been getting
**Error** Symbol=send, layer=Layer 1, frame=1:Line 1: Statement must appear within on handler
form.loadVariables("email.php", "POST");
**Error** Scene=Scene 1, layer=form, frame=1:Line 1: Statement must appear within on handler
form.loadVariables("emailmarc.php", "POST");
Total ActionScript Errors: 2 Reported Errors: 2
I would attach the file, but its 6kb too big. ask me and i will send it to you
View Replies !
View Related
HELP ...errors...
ive been through an mp3 tutorial...
THE PROBLEMS IS that it comes up wiv an error.
Error opening URL "file:///C|/Documents%20and%20Settings/mp3/undefined"
what does it mean???
and what shall i do???
i recieved this code...
// Setup sound object
var s:Sound = new Sound(); //s is the sound object
s.onSoundComplete = playSong; // on sound complete event... when mp3 finisha nd carry on with the next
s.setVolume(75); //inital volume = 75%
//create array to hold songs to read from xml
var sa:Array = new Array();
// create var to hold current playing song
var cps:Number = -1; //
//position of music
var pos:Number;
// Load the songs xml
var xml:XML = new XML(); //create xml object
xml.ignoreWhite= true; // ignore white spaces in xml
xml.onLoad = function()//repond to
{
var nodes:Array=this.firstChild.childNodes; // refering to song tags
//iterate
for(vari=0;i<nodes.length;i++)
{
sa.push(nodes[i].attributes.url);
}
playSong();
}
xml.load("songs.xml"); //load xml file
// play mp3 file function
function playSong():Void
{
s = new Sound();
if(cps == sa.length - 1) // if cps is the last song
{
cps=0;
s.loadSound(sa[cps],true); //start playing new mp3 sound
}
else
{
s.loadSound(sa[++cps],true);
}
playPause.gotoAndStop("pause");
}
//music controls
//pauses the music
function pauseit():Void
{
pos =s.position;
s.stop();
}
function unPauseit():Void
{
s.start(pos/1000);
}
//play/pause tohhle
playPause.onRollOver = function()
{
if(this.currentframe ==1)
{
this.gotoAndStop("pauseOver");
}
else
{
this.gotoAndStop("playOver");
}
}
playPause.onRollOut = playPause.onReleaseOutside = function()
{
if(this.currentframe ==10)
{
this.gotoAndStop("pause");
}
else
{
this.gotoAndStop("play");
}
}
playPause.onRelease = function()
{
if(this._currentframe == 10)
{
this.gotoAndStop("playOver");
this._parent.pauseit();
}
else
{
this.gotoAndStop("pauseOver");
this._parent.unPauseit();
}
}
//next button
next.onRollOver = function()
{
this.gotoAndStop("nextOver");
}
next.onRollOut = next.onReleaseOutside = function()
{
this.gotoAndStop("next");
}
next.onRelease=function()
{
this._parent.playSong();
}
View Replies !
View Related
New To AS3 And Already Getting ERRORS
I decided to start messing around with AS3 to see what I can do. So far I have been able to do NOTHING with it. I keep getting errors one of the errors is this one.
HTML Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at container$iinit()
Here is my code
Code:
package {
import flash.display.MovieClip;
import flash.events.Event;
import flash.geom.ColorTransform;
public class container extends MovieClip
{
private var mcColor:MovieClip;
private var COLOR_TRANSFORM:ColorTransform = mcColor.transform.colorTransform;
public function framework()
{
mcColor._Seasons(winter);
trace (mcColor.width);
}
private function _Seasons(name:String):void
{
switch(name)
{
case winter:
COLOR_TRANSFORM.color = 0x2b719e;
mcColor.transform.colorTransform = COLOR_TRANSFORM;
break;
case summer:
COLOR_TRANSFORM.color = 0x6b6f5b;
mcColor.transform.colorTransform = COLOR_TRANSFORM;
break;
}
}
}
}
As you can see it is pretty simple. Does anyone know why I am getting that error. Thanks
View Replies !
View Related
Errors.
im making a flash based email system on my website. ive been using this tutorial
theses are the errors i have been getting
**Error** Symbol=send, layer=Layer 1, frame=1:Line 1: Statement must appear within on handler
form.loadVariables("email.php", "POST");
**Error** Scene=Scene 1, layer=form, frame=1:Line 1: Statement must appear within on handler
form.loadVariables("emailmarc.php", "POST");
Total ActionScript Errors: 2 Reported Errors: 2
I would attach the file, but its 6kb too big. ask me and i will send it to you
View Replies !
View Related
Errors Any Other Way That I Tried
Hi guys, i was wondering if there is any way to make this code shorter?
the .fla code
Code:
import fl.transitions.*;
import fl.transitions.easing.*;
import GPS;
stage.frameRate = 50;
var Profile:GPS = new GPS("Profile", 100, 100);
var Portfolio:GPS = new GPS("Portfolio", 100, 200);
var Downloads:GPS = new GPS("Downloads", 200, 200);
var Contact:GPS = new GPS("Contact", 200, 100);
var Links:GPS = new GPS("Links", 150, 150);
var Current:GPS = new GPS("Current", 0, 0);
var myPositionTween:Tween;
var Name:String= "";
nav.Profile.addEventListener(MouseEvent.CLICK,getProfile);
nav.Portfolio.addEventListener(MouseEvent.CLICK,getPortfolio);
nav.Downloads.addEventListener(MouseEvent.CLICK,getDownloads);
nav.Contact.addEventListener(MouseEvent.CLICK,getContact);
nav.Links.addEventListener(MouseEvent.CLICK,getLinks);
function getProfile(event:MouseEvent):void
{
Name = event.target.name.toString()
trace(event.target.name.toString());
myPositionTween = new Tween(nav, "x", Strong.easeOut, Current.getCoordX(), Profile.getCoordX(), 20, false);
myPositionTween = new Tween(nav, "y", Strong.easeOut, Current.getCoordY(), Profile.getCoordY(), 20, false);
Current.setCoordX(Profile.getCoordX());
Current.setCoordY(Profile.getCoordY());
}
function getPortfolio(event:MouseEvent):void
{
Name = event.target.name.toString()
trace(event.target.name.toString());
myPositionTween = new Tween(nav, "x", Strong.easeOut, Current.getCoordX(), Portfolio.getCoordX(), 20, false);
myPositionTween = new Tween(nav, "y", Strong.easeOut, Current.getCoordY(), Portfolio.getCoordY(), 20, false);
Current.setCoordX(Portfolio.getCoordX());
Current.setCoordY(Portfolio.getCoordY());
}
function getDownloads(event:MouseEvent):void
{
Name = event.target.name.toString()
trace(event.target.name.toString());
myPositionTween = new Tween(nav, "x", Strong.easeOut, Current.getCoordX(), Downloads.getCoordX(), 20, false);
myPositionTween = new Tween(nav, "y", Strong.easeOut, Current.getCoordY(), Downloads.getCoordY(), 20, false);
Current.setCoordX(Downloads.getCoordX());
Current.setCoordY(Downloads.getCoordY());
}
function getContact(event:MouseEvent):void
{
Name = event.target.name.toString()
trace(event.target.name.toString());
myPositionTween = new Tween(nav, "x", Strong.easeOut, Current.getCoordX(), Contact.getCoordX(), 20, false);
myPositionTween = new Tween(nav, "y", Strong.easeOut, Current.getCoordY(), Contact.getCoordY(), 20, false);
Current.setCoordX(Contact.getCoordX());
Current.setCoordY(Contact.getCoordY());
}
function getLinks(event:MouseEvent):void
{
Name = event.target.name.toString()
trace(event.target.name.toString());
myPositionTween = new Tween(nav, "x", Strong.easeOut, Current.getCoordX(), Links.getCoordX(), 20, false);
myPositionTween = new Tween(nav, "y", Strong.easeOut, Current.getCoordY(), Links.getCoordY(), 20, false);
Current.setCoordX(Links.getCoordX());
Current.setCoordY(Links.getCoordY());
}
Here is the .as code imported into the .fla incase u need
Code:
package
{
public class GPS
{
private var CoordX:Number;
private var CoordY:Number;
private var name:String;
public function GPS(Desc:String, StartX:Number, StartY:Number)
{
setName(Desc);
setCoordX(StartX);
setCoordY(StartY);
}
public function setName(Desc:String):void
{
name = Desc;
}
public function getName():String
{
return name;
}
public function getCoordX():Number
{
return CoordX;
}
public function setCoordX(Value:Number):void
{
CoordX = Value;
}
public function getCoordY():Number
{
return CoordY;
}
public function setCoordY(Value:Number):void
{
CoordY = Value;
}
}
}
i experimented with classes, made up my own class with a constructor function thats sets the instance with 2 coordinates and a name. The objective here is the get the Nav movieclip to tween to the coordinates X and Y. I tried concatenating a string via (Event.Target.Name.ToString() + "Coord[0]") and placing the string into the 5th parameter of the tween function call.
Code:
myPositionTween = new Tween(nav, "x", Strong.easeOut, Current.getCoordX(), (Event.Target.Name.ToString() + "Coord[0]") , 20, false);
I would like to take the code in the .fla file from 5 independent static functions and make one dynamic function that would work for all 5 event listeners.
thx in advance
Jay
View Replies !
View Related
Script Errors?
When looking at the help page at: http://www.flashkit.com/tutorials/In...2/more13.shtml
I do exactly what it says and type in balkheight exactly as it is posted there. Also all the rest of the variables look exact. I push ok, then it says syntax error of ../../balkheight I get this over and over no matter what I do. What is wrong with this thing?? I really need this. Help! ./bulkheight ./balkheight /.balkheight /.bulkheight ../balkheight .........NONE of it works!!
View Replies !
View Related
Errors On Some Machines
A site I just finished is coming up with some errors on some machines, can anyone let me know if they have heard of or experienced any of the following errors.
The site is in flash5 and I have a basic plugin check at the beginning, it's just a tiny .swf that will perform a getUrl (I thought that flash4 could not perform that function?) if the getUrl never happens then I have an html redirect to the welcome screen saying please download flash5 plugin....
The Errors:
A user gets this if they go to the site they get messages about 'set text using variable' - the intro then runs, then they get the home page, but it's blank. When they try to load the site on another PC they get the preloader and it gets stuck on 100% and nothing will happen.
To me it sounds like the getUrl check is being performed but then other flash 5 commands are not functioning?
the link: http://eureka.ibghosting.net/client_.../asset_site12/
Thanks
m
View Replies !
View Related
W3C Validation Errors
Hello all,
When I check a page with the W3C validation service, it gave a list of errors confined to a table in which I embedded a .swf.
For instance: "Error: there is no attribute "HEIGHT" for this element (in this HTML version)."
And the same message for "SRC", and "PLUGINSPAGE", and a handful of others. All else in the page (HTML, CSS, Javascript) was okay. So, do I ignore the so-called errors? I know those tags have to be there so the browsers will play the movie...
TIA,
BT
---estudioworks, if you reply I promise not to gush
[Edited by BrainTea on 02-28-2002 at 09:34 AM]
View Replies !
View Related
PLEASE HELP Bus Errors In Flash 5.0
Has anyone esle been experiencing bus errors with Flash 5? I have tried everything in my power to resolve the matter, and nothing works. I have removed all the memory, except for 1 128MB chip, unplugged all peripherals (usb or scsi), disconnected my wacom tablet, zapped the PRAM, rebuilt the desktops.... and started with extensions off. It still crashes TOTALLY at random. There isnt one specific thing that sets it off.
PLEASE HELP! Macromedia techs don't have a clue....
View Replies !
View Related
Testing For Errors
Basically I'm loading images from a directory. They are respectively named 1.jpg, 2.jpg, 3.jpg, ect...
But I want to be able to ad and delete images from the directory without changing the flash. No problem BUT the only problem is: If I ad an image like 11.jpg, In My flash movie I want to test if it's loaded properly if not start at 1 again. HOW Do you test. Like if I put LoadMovie(myimage), if the images isn't there I get an error. Is there a way to test if the image is there or to test if it caused an error?
Thanks
View Replies !
View Related
Sbox Errors?
I'm trying to get flash forms to work but no luck.
Loadvariables does nothing, but GetURL redirects me to an Sbox error...says it can't find the file or directory.
I know the file or directory is there because it is apparently provided by my hosting servcie (go daddy).
Anyone know how to solve this?
thanks
tony
View Replies !
View Related
Spot The Errors
Here's a little game where you find the errors and fix them.
I'm hoping to get this fixed soon.
Car:
PHP Code:
onClipEvent (load) {
scrolly=_root.mainGround.ground._width/3;
scrollStart=false;
}
onClipEvent (enterFrame) {
_root.speed = speed;
if (Key.isDown(Key.UP)) {
if (this._x<scrollx){
speed += 1;
} else {
scrollStart=false;
}
}
if (Key.isDown(Key.UP)) {
if (this._y <75) {
scrollStart=true;
}}
if (Key.isDown(Key.DOWN)) {
speed -= 1;
}
if (Math.abs(speed)>20) {
speed *= .7;
}
if (Key.isDown(Key.LEFT)) {
_rotation -= 14;
}
if (Key.isDown(Key.RIGHT)) {
_rotation += 14;
}
speed *= .75;
x = Math.sin(_rotation*(Math.PI/180))*speed;
y = Math.cos(_rotation*(Math.PI/180))*speed*-1;
if (!_root.boundary.hitTest(_x+x, _y+y, true)) {
_x += x;
_y += y;
} else {
speed *= -.6;
}
x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.door1.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(3);
this._x = 111.1;
this._y = 276.0;
_x += x;
_y += y;
}
x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.door2.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(2);
this._x = 172.7;
this._y = 162.1;
_x += x;
_y += y;
}
x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.stair1.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(4);
this._x = 251.1;
this._y = 76.0;
_rotation -= 180;
_x += x;
_y += y;
}
x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.stair2.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(3);
this._x = 251.1;
this._y = 76.0;
_rotation += 180;
_x += x;
_y += y;
}
x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.door3.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(2);
this._x = 394.1
this._y = 357.0;
_x += x;
_y += y;
}
x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.door4.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(5);
this._x = 183.1;
this._y = 372.0;
_x += x;
_y += y;
}
x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.door5.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(2);
this._x = 428.1;
this._y = 169.0;
_x += x;
_y += y;
}
x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.door6.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(6);
this._x = 118.1;
this._y = 239.0;
_x += x;
_y += y;
}
x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.area2.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(2);
this._x = 428.1;
this._y = 169.0;
_x += x;
_y += y;
}
x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.area1.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(7);
this._x = 118.1;
this._y = 239.0;
_x += x;
_y += y;
}
}
onClipEvent (enterFrame) {
if (this._x> 639) {
this._x = 0;
}
}
onClipEvent (enterFrame) {
if (this._y> 577) {
this._y = 0;
}
}
onClipEvent (enterFrame) {
if (this._x <0) {
this._x = 639;
}
}
onClipEvent (enterFrame) {
}
onClipEvent (keyUp) {
if (Key.getCode() == Key.UP) {
scrollStart=true;
}
}
mainGround:
PHP Code:
onClipEvent (load) {
ground.duplicateMovieClip("ground2", 100);
ground2._y = ground._y+ground._height
groundStarty = this._y;
groundSpeed=10;
}
onClipEvent (enterFrame) {
if (_root.car.scrollStart==false){
this._y+=groundSpeed;
if (this._y<= (groundStarty+ground._height)){
this._y=groundStarty+groundSpeed;
}
}
}
View Replies !
View Related
Code Errors
I have a form with 2 textfields...when a user enters the wrong info, I have to have that textfield turn red, from green....
The first field can have any input as long as it's filled in...
The 2nd field requires "CM"
if(line_Input2 != "CM"){
if(line_Input1 == undefined){
line_Input1.backgroundColor = 0x00ff00;
line_Input1.backgroundColor = 0x00ff00;
line_Input2.backgroundColor = 0xff0000;
}
else {
line_Input2.backgroundColor = 0xff0000;
}
} else if(line_Input2 == "CM"){
if(line_Input1 == undefined){
_line_Input1.backgroundColor = 0x00ff00;
}
else {
gotoAndStop ("right1");
}
}
}
This is not working...
can someone help me with this...????
View Replies !
View Related
Flash5-->MX Errors
I generally use Flash 5 on all of my projects, becuase Flash MX has a random crash problem on my computer. However, I find myself in need now of Flash MX's onSoundComplete property, so I've been trying to switch the project.
Before I go any further, I'd like to know: is there any way to effectively simulate onSoundComplete in Flash 5? Because that would probably save me a lot of trouble.
Continuing: when I moved to Flash MX, I made all the changes I'm used to - converting my evals on the left side of assignment operators to this[ or root[, changing variable names that coincide with case insensitive object names, &c. But regardless, everything has gone to hell. I don't get any errors (which means I'm left completely in the dark), but none of my Movie Clips seem to be registerring in the root arrays that are supposed to store references to them. Generally, I define a function register() in each of these clips to handle this task, but when I put a trace inside of them, nothing appears on the console - they aren't being executed. Which is strange, because I can get a trace on the line before the function is declared and defined, and on the lines before and after the function is called. I define it like this: function register() { actions.... }. Does anybody know why this might happen? It's driving me crazy.
Thanks for your help and for tolerating my long-windedness.
EDIT: I think I have found the source of at least some of the problems - as far as I can tell, functions declared within conditional statements are invalid. Is this true? WHY!!!??? That seems crazy and obnoxious and stupid to me, since now I have to cut and paste them all -out- of the conditional statements. And the -least- they could've done was give me an error message...
View Replies !
View Related
AttachMovie Errors
Okay, I have a problem with this code:
Code:
layout = "0a0a0a0a0a0a0a0a0a0b0a1a1a1a1a1a1a1a1a0b0a1a1a1a1a1a1a1a1a0b0a1a1a1a1a1a1a1a1a0b0a0a0a0a0a0a0a0a0a0";
alpha = layout.split("b");
trace(alpha.lenght);
truealpha = alpha.split("a");
trace(truealpha.length);
depth = 1;
ypos = 0;
for(i = 0; i < alpha.length; i++) {
xpos = 0;
alpha = alpha[i];
truealpha = alpha.split("a");
for(j = 0; j < truealpha.length; j++) {
blockstatus = truealpha[j];
if(blockstatus <> 0) {
_root.attachMovie(eval("block"+blockstatus), eval("x"+i+"y"+j), depth++);
setProperty(eval("x"+i+"y"+j),_x,xpos);
setProperty(eval("x"+i+"y"+j),_y,ypos);
}
xpos = xpos + 20;
}
ypos = ypos + 20;
}
stop();
My library has a mc called "block1", which is a red 20x20 square.
This code should make a grid (10x; 5y) of red squares and blanks.
Also it should trace (to the output box) two lines:
The grid size (y axis)
The grid size (x axis)
However, when I run the the swf, nothing happens.
Its made for Flash 6 in MX (not 2004)
The file is attached.
View Replies !
View Related
How Do I Get Around Low Memory Errors?
I am making a short flash movie. So far the animation goes for just about a minute long but I got to the point where I can't compile it anymore.
I have 256mb of RAM and I am not sure if this is supposed to be happening with a animation that short. Even if the frame rate is 18 for second and I have A LOT of tweens, layers, movie symbols, etc...
What I am doing now is that for each scene I have a different fla file so I have no problems to compile each scene individually.
I only did half of the movie so far and haven't even added the sounds properly. Is there a way I could avoid this error and compile the whole movie at once? Or a way I could use a preloader to load the entire movie and then play it even though it is separated by several swf files?
View Replies !
View Related
MX Occuring Errors?
Hi all. Ive been making a project for a couple of months lately. Using Flash MX (6), ive suddenly got a error pop up (see attachment), and closes Flash itself. Whats going on? Has MX (6) got a massive hole ofbugs or something? Luckily i have a slightly older version of the work ive been doing and that seems to open well, but surely this should not happen? thx.
View Replies !
View Related
Debugging Errors?
hey can anyone explain to me why these errors show up when my page loads off the internet. I've looked through the coding and Can't figure it out. Again, I am terrible at action scripting, kinda more of an artist than a scripter. I don't want these to pop up, how can I get rid of them?
This is the site in question:
http://www.geocities.com/silverdrg0n/indexpage.html
contact me on aim if you can:
natethemoogle
View Replies !
View Related
Errors With Script
I get errors cam someone help me
thanks
Code:
action = "send";
loadVariablesNum (mailform, 0, "POST");
gotoAndPlay ("wait");
//if it was successfule gotoAndPlay ("confirmed")
//}else{ gotoAndPLay try again ..
if(success){
//
}
stop ();
View Replies !
View Related
Errors When Exporting
I am trying to create an animated logo for a college project, but having problems with exporting the file.
I'm quite new to flash, and when I view the animation within flash (by hitting return), it seems to play fine. The problem appears when I export the file.
Please take a look at the attached file (I hope it's not too big). As the door opens, it seems to leave a trail behind it at the bottom.
As I said, it seems to play fine actually in flash, the problem just appears to be after exporting it or testing it by hitting ctrl-enter in flash.
Anyone able to help me?
Sorry to anyone who feels like they are experiencing deja vu- I posted this recently, but was unable to resolve the problem
Any help would be hugely appreciated.
Thanks,
carly
View Replies !
View Related
Errors + Recovery
whilest working on a big flash document i recieved a strange error dialogue box stating something about "im crushing your head" and a few options.
ive recieved the message before but always been able to then save my work and force quit.
on this occasion however my document has been corrupted, when i try to open it i recieve a seek failed error.
so im a bit screwed.
I desperately need to get back into this file, i know its a bit naughty but i heard about some software which can convert swf back to fla. I really need to consider this but I was hoping for some advice first, on how reliable, safe any such software is and where I would find it.
also any ideas on what this "im crushing your head" error is would be helpful
View Replies !
View Related
Having Syntax Errors..please Help
i add a behavior to add sound to a pic and when i add a link to the pic as well i come up with a syntax error...it will still play the sound but wont go to the link
script=
// Play Sound Behavior
_global.Behaviors.Sound.b1 copy.start(0,1);
// End Play Sound Behavior
//Goto Webpage Behavior
getURL("http://www.google.com","_blank");
//End Behavior
any help would be appreciated.
View Replies !
View Related
Having Syntax Errors In Mx ..please Help
here is the code i used:
on (press) {
//Goto Webpage Behavior
getURL("http://www.google.com","_blank");
//End Behavior
}
on (release) {
// Play Sound Behavior
_global.Behaviors.Sound.b1 copy.start(0,1);
// End Play Sound Behavior
}
the picture does play the sound but wont link to the page specified..and i get syntax errors..
View Replies !
View Related
Script Errors
I have a date and time clock on my site and it works perfect. I just get 3 errors when published. Here are the errors-
**Error** Symbol=OI Custom Methods, layer=Layer 1, frame=1:Line 43: There is no method with the name 'duplicate'.
this+= ("0").duplicate (remPlaces);
**Error** Symbol=OI Custom Methods, layer=Layer 1, frame=1:Line 45: There is no method with the name 'duplicate'.
this+= "." + ("0").duplicate (places);
**Error** Symbol=OI Custom Methods, layer=Layer 1, frame=1:Line 120: There is no property with the name 'rnd'.
Math.rnd = function (start, end) {
Total ActionScript Errors: 3 Reported Errors: 3
I'm not quite sure how to fix it. I borrowed the script from a buddy and he can't figure it out either. Any help/suggestions would be greatly appreciated. Thanks!
View Replies !
View Related
MtClip Errors
These are some errors I am getting:
**Error** Scene=Scene 1, layer=Audio Load, frame=2:Line 1: Statement must appear within on/onClipEvent handler
_root.audiomtClip.loadMovie("discotraxx.swf");
**Error** Scene=Scene 1, layer=Main Images, frame=2:Line 1: Statement must appear within on/onClipEvent handler
_root.mtClip.loadMovie("main.swf");
What am I doing wrong?
View Replies !
View Related
Mac Os X Menu - Errors
I have followed the tutorial:
http://www.flashkit.com/tutorials/In...-722/index.php
and keep getting errors from the code such as this:
Symbol=control, Layer=Layer 2, Frame=1: Line 1: Clip events are permitted only for movie clip instances
onClipEvent (load) {
Symbol=control, Layer=Layer 2, Frame=1: Line 14: Clip events are permitted only for movie clip instances
onClipEvent (mouseMove) {
any hints as to what is wrong with this?
View Replies !
View Related
Rounding Errors
Hi
I'm having trouble rounding some numbers. I expected it would be a simple task, and I'm sure there's no problem with the code ....
code:
magnifier._x = Math.round(this._x-this._width/2);
magnifier._y = Math.round(this._y-this._height/2);
magnifier._width = Math.round(w);
magnifier._height = Math.round(h);
'w' and 'h' are values passed from another function that limits the size of a different mc. 'Magnifier' is an empty mc placed on the stage. I insert a bitmap into it using ....
code:
import flash.display.BitmapData;
function Magnifier(target) {
var bitmapData:BitmapData = new BitmapData(content_mc._width,content_mc._height, true, 0);
bitmapData.draw(target);
magnifier.attachBitmap(bitmapData, -10);
}
The rounding works for 80% of the time, but on a couple of occasions it's off by 0.05 or 0.1, so I get values like 67.95 for width when it should be 68.
What could be causing an error like this? I'm pretty sure there's no problem with my code.
thanks
mark
flash8
View Replies !
View Related
Code Errors
I can't seem to figure out what the hell is wrong with this code of mine.
Code:
on(release) {
if (flashtruefalse == 0)
gotoAndStop("computer")
}
} else if (flashtruefalse == 1) {
gotoAndStop("computer2")
}
It says something about there being an extra '}' somewhere. Then when I go to delete one, it says the else if statement is screwed up. Any ideas?
View Replies !
View Related
Suppressing Certain Errors
I'm thinking about moving to an external AS editor. My current project is still very incomplete and already has about 800 lines of code. Granted, about half of that is due to libraries I am including, but I'm still considering moving to SE|PY so I can organize my thoughts and code more effectively.
Anyway, I went through all the frames and movie clips that have substantial amounts fo AS attached to them and exported them. I replaced them in Flash with #includes for the exported scripts. It worked great, except now I am getting a useless error:
Code:
ActionScript 2.0 class scripts may only define class or interface constructs.
The application I am building still seems to compile and run properly, so I don't really care about the above. The problem is it pulls up my Output console and fills it with a dozen useless errors when I am testing/debugging my project. Is there a way to suppress this particular error in Flash MX 2k4?
Thanks! =)
View Replies !
View Related
Flashtrax Errors
Hi, i have downloaded the flashtrax player. I run the .swf and it playes fine.
I copy the player over to my website and it gives the follwing errors
Quote:
**Error** Symbol=player_mc, layer=actions, frame=2:Line 1: Operator '/' must be followed by an operand
if (load/:load eq "yes") {
**Error** Symbol=player_mc, layer=actions, frame=4:Line 5: ')' or ',' expected
duplicateMovieClip("eq", "eq" add i, 10+Number(i));
**Error** Symbol=player_mc, layer=actions, frame=4:Line 6: ')' or ',' expected
duplicateMovieClip("dot", "eqdot" add i, 20+Number(i));
**Error** Symbol=MusicOnOff MovieButton, layer=Layer 3, frame=1:Line 6: Unexpected '.' encountered
../:status = "stop";
**Error** Symbol=MusicOnOff MovieButton, layer=Layer 3, frame=1:Line 7: Unexpected '}' encountered
}
**Error** Symbol=MusicOnOff MovieButton, layer=Layer 3, frame=10:Line 8: Unexpected '.' encountered
../:status = "play";
**Error** Symbol=MusicOnOff MovieButton, layer=Layer 3, frame=10:Line 9: Statement must appear within on handler
gotoAndStop("on");
**Error** Symbol=MusicOnOff MovieButton, layer=Layer 3, frame=10:Line 10: Unexpected '}' encountered
}
**Error** Symbol=player_mc, layer=actions, frame=6:Line 1: Operator '/' must be followed by an operand
playtime = getTimer()-starttime-(load/:fulllen)*loop;
**Error** Symbol=player_mc, layer=actions, frame=6:Line 2: Operator '/' must be followed by an operand
j = int(playtime/((load/:step)));
**Error** Symbol=player_mc, layer=actions, frame=6:Line 6: ')' or ',' expected
sc = substring(eval("load/:data" add j),(i*2)+1,2);
**Error** Symbol=player_mc, layer=actions, frame=6:Line 7: 'else' encountered without matching 'if'
} else {
**Error** Symbol=player_mc, layer=actions, frame=6:Line 10: ')' or ',' expected
setProperty("eq" add i, _yscale, 1+Number(sc));
**Error** Symbol=player_mc, layer=actions, frame=7:Line 1: Operator '/' must be followed by an operand
if (Number(j)<Number(load/:rows)) {
Total ActionScript Errors: 14 Reported Errors: 14
Any Ideas? why is it throwing up so many errors?
View Replies !
View Related
FLA File Errors
Ok, im working on a website and i made a few buttons, then I gave it a instance name, Well im still learning how it all works... Now when i try to load the saved fla into flash it will crash flash 8 pro, no error messages, just closes the program. I can see my library and if i move my cursor over the button i made, it also causes flash to just close. If i just let it sit there windows will time it out and it will close as well. I have spent alot of time on this file, is there a way to load the file in a fail safe mode? or anything that can salvage the work?
View Replies !
View Related
Errors On New Site
Hi,
I've created a site for a client, and he's come back sayinf that the have been complaints about loading errors... He's given me no more details.
I've tried in different brosers and all seems fine (on a mac).
Please could anyone take a look and see if any error messages appear.
No idea where to start...
http://www.millbayplymouth.com/
View Replies !
View Related
[F9] Compiler Errors
This is my first time posting in this forum and have been very impressed thus far. I am experimenting with a software package developed by Flash Menu Labs. When I generated the code the following code was generated with 6 compiler errors. I am a true nubee to Flash so I do not know if I have presented a complicated issue. I appreciate any comments or advice on this project. RioMaria
----------------------------
function aso#63706
{
if (postfix != undefined)
{
aso#86691.aso#67461 = postfix;
}
{
aso#86691.aso#67461 = _root.aso#40300;
} // end else if
var loaderX = Stage.width / 2 - 45;
var loaderY = Stage.height / 2 - 10;
aso#44347 = attachMovie("loader_mc", "aso#44347", this.getNextHighestDepth(), {_x: loaderX, _y: loaderY});
aso#19970.load("data" + aso#86691.aso#67461 + ".xml");
} // End of the function
function aso#02974()
{
aso#22204 = new aso#00611(aso#86691);
setProperty("", _focusrect, false);
} // End of the function
var aso#86691 = new aso#97827();
aso#86691.aso#70116 = this;
var aso#19970 = new XML();
aso#19970.ignoreWhite = true;
var aso#44347;
var aso#16765;
var aso#57296 = new Date();
var aso#42113 = 0;
var aso#18578 = 0;
var aso#49915 = 0;
var aso#81252 = 0;
var aso#12589 = 0;
aso#16765 = false;
aso#19970.onLoad = function (success)
{
aso#16765 = true;
if (success)
{
var _loc1 = new aso#60501(aso#86691);
aso#86691.aso#44347 = aso#86691.aso#70116.aso#44347;
_loc1.aso#17736(aso#19970);
aso#02974();
var _loc3 = _loc1.aso#20941();
var _loc2 = new aso#59109(0, 0, "menu", 0, null, aso#86691);
aso#86691.aso#36545 = _loc2;
_loc2.aso#13560(_loc3, 0, null);
} // end if
};
aso#63706();
this.menuItem_mc._visible = false;
onEnterFrame = function ()
{
delete aso#57296;
aso#57296 = new Date();
var _loc1 = aso#57296.getTime() - aso#80702;
aso#80702 = aso#57296.valueOf();
if (_loc1 < 10)
{
_loc1 = 10;
} // end if
if (_loc1 > 80)
{
_loc1 = 80;
} // end if
aso#42113 = aso#18578;
aso#18578 = aso#49915;
aso#49915 = aso#81252;
aso#81252 = aso#12589;
aso#12589 = _loc1;
if (aso#42113 > 1.000000E-003 && aso#18578 > 1.000000E-003 && aso#49915 > 1.000000E-003 && aso#81252 > 1.000000E-003 && aso#12589 > 1.000000E-003)
{
_loc1 = aso#42113 + aso#18578 + aso#49915 + aso#81252 + aso#12589;
_loc1 = _loc1 / 5;
}
else
{
_loc1 = 20;
} // end else if
if (aso#16765 && aso#86691.aso#17607 > 0)
{
if (_loc1 < 10)
{
_loc1 = 10;
} // end if
if (_loc1 > 80)
{
_loc1 = 80;
} // end if
aso#86691.aso#36545.aso#07571(_loc1 / 200);
} // end if
};
var aso#22204;
View Replies !
View Related
2 Simple Errors....
Ok, I have two errors that are giving me the fits at the moment! I can't seem to solve them no matter what I do! Well here is the error compilation...
5000: The class 'code.MenuXML' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
This error is a result of my first line of code here:
package code{
I have the actionscript file in the folder code, and is called by menu.fla as the document class by the following path:
code.MenuXML
1180: Call to a possibly undefined method addChild.
the addChild error is a result of the following code...
var yPos:Number = 0;//y position of next button
var menuHolder:Sprite = new Sprite();//holds the menu
addChild(menuHolder);// put holder on stage
View Replies !
View Related
Help With Errors On Publishing
I'm trying to convert this one movie from AS 1.0 fp 6 to As 2 fp 8 and I'm getting some errors at publishing I need help desperately. here are some of the errors:
error 01________________________________________________ _______________
Description: ')' or ',' expected
error Source:
Code:
if (contenturl1 ne "") {
loadVariablesNum(contenturl1 add "/" add userid add "/content.txt", 0);
} else {
loadVariablesNum("content.txt", 0);
}
__________________________________________________ _______________
error 02________________________________________________ _______________
Description: } else {
error source:
Code:
if (contenturl1 ne "") {
loadVariablesNum(contenturl1 add "/" add userid add "/content.txt", 0);
} else {
loadVariablesNum("content.txt", 0);
}
__________________________________________________ _______________
error 03________________________________________________ _______________
Description: ')' or ',' expected
error Source:
Code:
loadMovie(_root.contenturl1 add "/" add _root.userid add "/img1main.jpg", "loadimages.img1");
error 04________________________________________________ _________
Description: Identifier expected
error source:
Code:
var x01 = 717;
__________________________________________________ _____________
I appreciate the help
View Replies !
View Related
[F8] ActionScript Errors
I've tried adding the following to a button but get the errors below. Im not sure what to add to correct this. According to the errors, it looks like I need to add a handler, but I'm not sure how to do that. Any help is appreciated. thanks
var mouseWheel:Object = new Object();
mouseWheel.onMouseWheel = function(direction:Object) {
trace(direction);
if(direction > 0) {// Mouse wheel is moving up
if(_root._currentframe != 1) {
_root.gotoAndStop(1);
}
}else if(direction < 0) {// Mouse wheel is moving down
if(_root._currentframe != 3) {
_root.gotoAndStop(3);
}
}
}
Mouse.addListener(mouseWheel);
**Error** Scene=Scene 1, layer=main, frame=3:Line 1: Statement must appear within on handler
var mouseWheel:Object = new Object();
**Error** Scene=Scene 1, layer=main, frame=3:Line 3: Statement must appear within on handler
mouseWheel.onMouseWheel = function(direction:Object) {
**Error** Scene=Scene 1, layer=main, frame=3:Line 16: Statement must appear within on handler
Mouse.addListener(mouseWheel);
Total ActionScript Errors: 3 Reported Errors: 3
View Replies !
View Related
|