Whats Wrong With My Code? GetDate()
Hi, Heres a piece of code I wrote to get the date from the user computer and tell a specific target to jump to a frame.
The idea is that when we reach the 15th of each month it displays a different frame.
The problem is, I can't make it work. It jumps to frame 15 regardless of the date.
Could you guys please help me? this is really simple, I'm completely new to actionscript and I've looked everywhere in google for hours with no success.
This is the code:
Code: var current_date:Date = new Date(); if (current_date.getDate()>=15) { tellTarget (_root.scFour.scroll2) { gotoAndStop(10); } } else { tellTarget (_root.scFour.scroll2) { gotoAndStop(1); } } Thanks
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 05-16-2006, 06:31 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Whats Wrong With This Code?
this is the code i have on my preloader, together with a word "Loading" that is soposed to be blinking. instead the word blinked once and then it stoped and stayed like that. i tryed to make it a movie clip and graphic, and it still didnt blink. here is the code:
on frame one:
ifFrameLoaded ("site", 21) {
gotoAndPlay ("next scene", 1);
play ();
}
on frame ten:
gotoAndPlay ("site", 1);
Whats Wrong With This Code ?
onClipEvent (load) {
i=0;
num=0;
_root.starttime =getTimer();
}
onClipEvent (enterFrame) {
_root.currenttime = getTimer();
}
onClipEvent (enterFrame) {
starttime+=2000;
difference = _root.currenttime - _root.starttime;
if (difference > 2000) {
i++;
num++;
pos=random(500);
duplicateMovieCli("_root.man", "man"+i,num);
setProperty("_root.man"+i, _x, pos);
}
}
basically i have a movieclip called "man" and i want it to duplicate every 2 seconds. It duplicates fine on the first one and the next one and there after is weird. It sometimes changes the position of the last clip and sometimes duplicates 2. I hope somebody can see the bug here somewhere, i've tried everything.
Maybe its just bad coding.
Whats Wrong With This Code ?
can someone please tell me whats wrong with the following code
onClipEvent (enterFrame) {
if (this.hitTest(_root.Rail)) {
this._x = 10;
}else{
this._x = this._x + 10;
}
}
Rail is simply a movie clip, i want an mc to keep moving right until it hits the mc Rail. But when i run this the moving mc doesn't move.
Can someone please tell me where i've gone wrong ??
Whats Wrong With This Code?
Hi All,
preloader not working...im using the following code as the guts of the preloader:
loadedbytes=getBytesLoaded();
totalbytes=getBytesTotal();
loadedkbytes=Math.ceil (loadedbytes/1000);
totalkbytes=Math.ceil(totalbytes/1000);
if (loadedbytes == totalbytes) {
nextScene ();
}
frame = int(loadedbytes/(totalbytes/100));
tellTarget (_root.loader) {
gotoAndStop (_root.frame);
}
its all pretty self explanitory. The next scene doesnt have any stop action or any of that...its ready to go...it all works if you oreview in flash (MX) Ctrl > Enter...
it seems to work, but then just before it shows the new scene, it freakin loops again and starts preloading...but IE6 says 'done', as in, finished downloading!
You can see here
http://www.millenniumit.freewebsitehosting.com/
i dont know why Can anyone help me???
cheers
Whats Wrong With This Code?
I have a preloader that just won't seem to work! It just starts and then it stops after it loads 2kb
--------------------------------------
total = int(_root.getBytesTotal()/1024) add " KB";
download = int(_root.getBytesLoaded()/1024) add " KB";
bytesleft = int(_root.getBytesTotal()-_root.getBytesLoaded()) add " KB";
percent = int(_root.getBytesLoaded()/_root.getBytesTotal()*100) add " %";
if (percent == "100%") {
gotoAndStop("Open", 1);
} else {
gotoAndPlay(1);
}
--------------------------------------
Whats Wrong With My Code
Can someone explain why my code won't work I've been at this all-day
Its now driving me crazy
My Code is below and the error is under it
if (_level2&&_level3) {
unloadMovieNum(2);
unloadMovieNum(3);
loadMovie(aboutrev.swf, 2);
} else {
_root.gotoAndStop(65);
}
Scene=Scene 2, Layer=NavigationButtons, Frame=65: Line 1: Statement must appear within on handler
if (_level2&&_level3) {
Ok Whats Wrong With This Code.
Everything works great..... EXCEPT that the text on top of the MC doesnt change. In debug I see all the Car[Q] data, it just doesnt change on each of the MC's
I have a MC named carball1 up to carball21
Each of the MC's have a dynamic text box named "carno", with a variable named "carnumber"
var Car = new Array();
var Left = new Array();
var Top = new Array();
Car = CAR.split("|");
Left = L.split("|");
Top = T.split("|");
CC = Number(CC) - 1;
for (Q=1; Q<CC; Q++){
Left[Q] = Number(Left[Q])
Top[Q] = Number(Top[Q])
W = String("carball" + Q);
setProperty(W,_X,Left[Q]);
setProperty(W,_Y,Top[Q]);
W.carno.carnumber = Car[Q];
}
gotoAndPlay(1);
I have tried the following.....
_root.W.carno.carnumber
_layer0.W.carno.carnumber
_root.carno.carnumber
_layer0.carno.carnumber
with no luck.
Please help
Thanks.
Mike
Whats Wrong With This Code?
Hey,
I'm trying to get it so that someone opens a mc, which ever one they had open last will auto close, so they don't over lap... and so I don't have to make the user close the mc them selves.. they can jus hit another button and the curretn mc wil close before the new one opens.
How ever the code I got does nothing at all, none of the buttons even open.
Code:
stop();
function next(mc) {
if (currentMC != null && currentMC != mc) {
currentMC.gotoAndPlay('close');
}
}
btn1.onPress = function() {
next(mc1);
};
btn2.onPress = function() {
next(mc2);
};
btn3.onPress = function() {
next(mc3);
};
btn4.onPress = function() {
next(mc4);
};
btn5.onPress = function() {
next(mc5);
};
btn6.onPress = function() {
next(mc6);
};
btn7.onPress = function() {
next(mc7);
};
btn8.onPress = function() {
next(mc8);
};
btn9.onPress = function() {
next(mc9);
};
btn10.onPress = function() {
next(mc10);
};
btn11.onPress = function() {
next(mc11);
};
btn12.onPress = function() {
next(mc12);
};
Thanks,
Ian
Whats Wrong With My Code
I have a movieclip on the stage on a keyframe that has a stop. he movieclip has its _alpha manually set to o using the properties pane.
What I need it to do is when the clip enters the movieclip it asks itself is my alpha less then 100% YES then ok increase myself by 5%. Because I have a stop and I am using an onClipEvent(enterframe) it should gradually increase until its aplha reaches 100%. It appears to be doing that ok as the clip fades in gradually. What I need it to do then is once it has reached 100% it should break its loop and move to frame 2 with the label "s2" but it is not doing that.
Code on the movieclip
--------------------------
onClipEvent(enterFrame){
if (this._alpha != (100){
this._alpha +=5;
}else{
gotoandPlay("s2");
}
}
As I said it fades up alright but wont go to the appropriate next frame once it reaches full alpha.
It has to be something simple!
If anyone can help then I would be most grateful.
Thanks pixelmagik
Whats Wrong With This Code?
Im using Flash MX 2004 Pro..
Ive got a button that on press I want to rin a small movie..
Everytime I press the button the button just dissapears..?
Heres my code..
code: on (press) {
tellTarget (_root.thumb_outline) {
gotoAndPlay(2);
}
}
Thanks in advance.
Whats Wrong With My Code?
everything works fine but my hitTest. Somwthing is wrong with it. peace help
code:
//defined decay
decay = .98;
//defined objects for puck
puck1 = {};
puck1.clip = puck;
puck1.x = puck._x;
puck1.y = puck._y;
puck1.radius = puck._width/2;
puck1.xmov *= decay;
puck1.ymov *= decay;
puck1.x += puck1.xmov;
puck1.y += puck1.ymov;
//defined objects for paddle
paddle1 = {};
paddle1.clip = paddle;
paddle1.x = paddle._x;
paddle1.y = paddle._y;
paddle1.vx *= decay;
paddle1.vy *= decay;
paddle1.radius = paddle._width/2;
//define puck movement
function movePuck() {
if (puck1.clip.y+puck1.ymov<79)
{
puck1.y = 79;
puck1.ymov = -puck1.ymov;
}
if (puck1.y+puck1.ymov>73+243)
{
puck1.y = 73+243;
puck1.ymov = -puck1.ymov;
}
if (puck1.x+puck1.xmov<70)
{
puck1.x = 70;
puck1.xmov = -puck1.xmov;
}
if (puck1.x+puck1.xmov>69+462)
{
puck1.x = 69+462;
puck1.xmov = -puck1.xmov;
}
}
//paddle calculates its velocity and stores it so it can transfer it when it hits the puck
function paddleDrag() {
paddle1.clip.onPress = function(){
paddle1.clip.isDragging = true;
paddle1.clip.vx = paddle1.clip.vy = 0;
paddle1.clip.lmx = _root._xmouse;
paddle1.clip.lmy = _root._ymouse;
paddle1.clip.startDrag(false);
}
}
// stop dragging of paddle
function paddleNoDrag() {
paddle1.clip.onRelease = function() {
paddle1.clip.isDragging = false;
paddle1.clip.stopDrag();
}
}
//real hitTest
function paddleToPuckDetection(puck1, paddle1) {
var xDiff = puck1.x - paddle1.x;
var xDiff = puck1.y - paddle1.y;
var distance = Math.sqrt(xDiff*xDiff+yDiff*yDiff);
if (distance <= puck1.radius+paddle1.radius) {
puck1.xmov = paddle1.vx;
puck1.ymov = paddle1.vy;
}
}
//
//simple hitTest to see if puck actualy moves after hitTest. only for testing.
function testHit(){
if (puck1.hitTest(paddle1)) {
puck1.xmov = paddle1.vx;
puck1.ymov = paddle1.vy;
}
}
//
//
function paddleVelocity() {
if (paddle1.clip.isDragging) {
paddle1.vx;
paddle1.vy;
paddle1.vx = _root._xmouse -paddle1.clip.lmx;
paddle1.vy = _root._ymouse -paddle1.clip.lmy;
paddle1.clip.lmx = _root._xmouse;
paddle1.clip.lmy = _root._ymouse;
}
}
_root.onEnterFrame = function() {
//testHit();
paddleVelocity();
movePuck();
paddleDrag();
paddleNoDrag();
paddleToPuckDetection(puck1, paddle1);
};
Whats Wrong With This Code?
im experimenting with sum stuff and i cant get this code to work...whats wrong with this code??? cos it aint workin!
code:
bytes_loaded = Math.round(getBytesLoaded());
bytes_total = Math.round(getBytesTotal());
getPercent = bytes_loaded/bytes_total;
half = Math.round (bytes_total/2);
if (bytes_loaded = half){
_root.munch.text = "50% loaded";
}
as u can see when it has loaded 50% of the content i want a text box with instance name munch to display the text 50% loaded
Whats Wrong With This Code?
WAAAAAHH,
Iv got this code in my "ground" mc, to hittest for a ship hitting it.
code:
onClipEvent(enterFrame){
if (_root.Ship.square.hitTest(this._x , this._y , true)){_root.gotoAndStop("2")}
}
in side the "Ship" mc, iv got lots of transparant squares dotted around the edges to mark the boundary, all of these are the same "sqaure" mc, whats wrong with this code???
any help is appreciated, im using actionscript 2,
beedle
Whats Wrong With This Code...?
i have a button i have these to code..
it is to give values to some variables.
i am trying to turn a string into a number using the
number() method.
but for somereason, when i call back the variable to display
in a D textbox.. it always returns as NaN (not a number)
on(release)
{
gotoAndPlay(2);
var menu1quant = menu1quant.text;
var menu1quantNUM = Number(menu1quant);
var CPtotal = menu1quantNUM *15;
}
cp total is the variable i am trying to call to a d textbox
that returns as NaN..
dont know.. pleaz advice on wuts wrong
...
-_-
Whats Wrong With This Code?
on (release) {
if (_root.firesplittermove._currentframe >=40) {
if (_root.firesplittermove._currentframe <=68) {
_root.message1 = "Currently recharging.";
}
}else if (_root.firesplittermove._currentframe > 68) {
_root.message1 = "";
}
}
basically i want the message to stop sayign currently recharging after frame 68 but it doesnt change
whats wrong??
Whats Wrong With My Code?
On frame 1 I've got this code:
Code:
knop.onRelease = function() {
gotoAndStop(2);
};
On frame 2 this code:
Code:
trace ("clicked");
No matter how much I click, it only gets traced once?
I've also tried this code:
Code:
knop.onRelease = function() {
gotoAndPlay(2);
};
And on frame 2:
Code:
stop();
trace ("clicked");
What then happens: at click 1 "clicked" is traced, at click 2 it traces nothing and goes back the frame 1???, at click 3 it goes to frame 2 again and traces "click" etc etc
What should happen is that on each click it should go to frame 4 and trace "clicked" but I can't get it to work?
Whats Wrong With My Code?
Hey
PHP Code:
import mx.transitions.Tween; import mx.transitions.easing;var popLoad:Tween = new Tween(popupMC.bgMC, "_alpha", Elastic.easeIn, 0, 80, 40, false); popupMC.pop._visible = false;showPopUp = function() { if (popupMC.bgMC._alpha >= 78) popupMC.pop._visible = true; }onEnterFrame = function() { showPopUp(); trace(popupMC.bgMC._alpha )}hidePopup = function() { if (popupMC.bgMC._alpha <= 78) popupMC.pop._visible = false;}popupMC.pop.close.onRelease = function() { //trace(popupMC.bgMC._alpha ) //unloadMovie(popupMC) hidePopup(); var popUnload:Tween = new Tween(popupMC.bgMC, "_alpha", Elastic.easeOut, 80, 0, 40, false); }
What I'm trying to do is when the fla loads the background's alpha will go from 0 to 80, then the "pop" will appear >80. How come when I trace the alpha stays at 79.6875?
Also,
When I try to hide popup, it doesn't work.
If someone can look at my code and tell me whats wrong with it, it will be a great help.
thanks vxd
Whats Wrong With This Code?
i wrote this code
Code:
package
{
import flash.display.Shape;
import flash.events.Event;
public class movingcircle extends Shape
{
public var xspeed:Number;
public var yspeed:Number;
public function movingcircle()
{
//graphics is inherited from shape
graphics.beginFill(0xff9933, 1 );
graphics.drawCircle(0,0,40);
}
//initialize, called after addChild
public function init():void
{
x = Math.random() * (stage.stageWidth);
y = Math.random() *(stage.stageHeight);
xspeed = Math.random() * 10;
yspeed = Math.random() * 10;
addEventListener(Event.ENTER_FRAME,step);
}
public function step(event:Event):void
{
//bounce ball at stage edges
if(x + xspeed > stage.stageWidth)
{
xspeed *= -1;
}
else if(x + xspeed < 0)
{
xspeed *= -1;
}
if(y + yspeed > stage.stageHeight)
{
yspeed *= -1;
}
else if(y + yspeed < 0)
{
yspeed *= -1;
}
x += xspeed;
y += yspeed;
}
}
}
and saved it as movingcircle.as. it compiled correctly without any errors, but when i veiwed movingcircle.swf in firefox, it was just a blank flash page. anyone have an idea?
Whats Wrong With My Code...?
Hey,
I have this code to retrieve the html code from a URL and put it into a variable but it doesnt seem to be working.
Quote:
System.security.allowDomain('google.com');
loader = new LoadVars();
loader.onData = function(src) {
var contents = src;
};
loader.load("http://google.com");
Any Ideas?
Thanks!
Whats Wrong With This Code
ActionScript Code:
var randomNumber:int = Math.random()*250
stage.addEventListener(Event.ENTER_FRAME, enterFrameEvent);
btnGuess.addEventListener(MouseEvent.CLICK, buttonClicked);
function enterFrameEvent(event:Event):void {
// nothing here yet
}
function buttonClicked(event:MouseEvent):void {
if(txtGuess.text == randomNumber){
trace("win")
}
}
trying to make a guessing game, but when i try that it comes up with this error
1176: Comparison between a value with static type String and a possibly unrelated type int.
if(txtGuess.text == randomNumber){
no idea why it wont work! looks right to me, what about you guys?
Whats Wrong With My Code? Can Anyone Please Help?
stop(); // Stops the Main Timeline
var ToF:Boolean; // ToF (True or False
if (ToF == true){
play();
}else{
stop();
}
square.onPress = function(){ // Movie Clip Button
ToF = true;
}
circle.onEnterFrame = function(){ // Animated Movie Clip
ToF = false;
}
Im trying to learn how to do that True or False but I don't know why
it doesn't work.
I have 100 frames total, with the circle tween from frame 1 - 100.
I added a stop() command to stop the main timeline.
and Made a movie clip button and gave it an instance name "square".
If square is pressed, it would make ToF = true, then passing it to my if
statement. But why doesn't it play the main timeline.
///////////////////////////////////////
stop();
square.onPress = function(){
play();
}
//////////////////////////////////////
This code works because it just stops the main timeline and plays it again
when the button is pressed.
But how can I tell it that when the button is pressed it would make some
value to true or false then passed that value to do something.
Can anyone please tell me whats wrong?
Not Sure Whats Wrong With My Code
Hi there im new to the forum just got started in flash and really liking the things you can do with it. i have come up with a problem and wondered if you guys might be able to help me out or refer me to another website?
Basically this.answer_txt.text is where a string is entered. This string could be 123 or 34,965 or 327,982,943 and so on. Below i have tried to make it so it checks the length of the string size then does an action.
for example if the length of num = 5 (e.g 1,234) characters long then make num = 1234. It selects the first char and the sub string from points 2 - 5.
this works ok but it also does the same no matter what i do it on if its 8 chars long or 11 so on?
Really hope you can help. If you require any more info please PM me
The code im using is here VVVVVVV
on (release) {
var myString = this.answer_txt.text
trace(myString)
var Num = myString
trace (Num)
if (Num.length = 5) {
var Num = myString.charAt(0) + myString.substring(2, 5)
this.myText_txt.text = Num }
else if (Num.length = 6) {
var Num = myString.substring(0, 2) + myString.substring(3, 6)
this.myText_txt.text = Num }
else if (Num.length = 7) {
var Num = myString.substring(0, 3) + myString.substring(4, 7)
this.myText_txt.text = Num }
else if (Num.length = 9) {
var Num = myString.charAt(0) + myString.substring(2, 5) + myString.substring(6, 9)
this.myText_txt.text = Num }
else if (Num.length = 10) {
var Num = myString.substring(0, 2) + myString.substring(3, 6) + myString.substring(7, 10)
this.myText_txt.text = Num }
else if (Num.length = 11) {
var Num = myString.substring(0, 3) + myString.substring(4, 7) + myString.substring(8, 11)
this.myText_txt.text = Num }
else if (Num.length = 13) {
var Num = myString.charAt(0) + myString.substring(2, 5) + myString.substring(6, 9) + myString.substring(10, 13)
this.myText_txt.text = Num }
else if (Num.length = 14) {
var Num = myString.substring(0, 2) + myString.substring(3, 6) + myString.substring(7, 10) + myString.substring(11, 14)
this.myText_txt.text = Num }
}
Can Someone Tell Me Whats Wrong With This Code
ok so can someone explain this to me, im new to as3, i got the code to LOAD an external.swf. but the problem is, it only loads the 1 swf properly.
heres what i mean
im working with a book and in the example/tutorial it tells me to load an external swf called "movie.swf"
var imageRequest:URLRequest = new URLRequest("movie.swf");
var imageLoader:Loader = new Loader();
imageLoader.load(imageRequest);
addChild(imageLoader);
now when i put another .swf in place of that "movie.swf" the preivew window comes up with a blank screen. and when i change the .swf BACK to "movie.swf" it works again. and im putting the swf file in the same folder as the fla.
can anyone tell me why it wont load anything OTHER then that "movie.swf" ? oh heres another thing, i got help from this forum and the code works also when i want to load the "movie.swf" but if i try and put in a different swf name nothing happens blank screen
var myLoader:Loader = new Loader();
var url:String="movie.swf";
var myRequest:URLRequest = new URLRequest(url);
myLoader.load(myRequest);
addChild(myLoader);
Attach Code
//code from the book. they both work but only to load that one "movie.swf"
var imageRequest:URLRequest = new URLRequest("movie.swf");
var imageLoader:Loader = new Loader();
imageLoader.load(imageRequest);
addChild(imageLoader);
//code from the forum
var myLoader:Loader = new Loader();
var url:String="movie.swf";
var myRequest:URLRequest = new URLRequest(url);
myLoader.load(myRequest);
addChild(myLoader);
Whats Wrong With This Code?
ok wen i use this code i can only use it 3 times after i use it 3 times another one of these codes destorys it self how can i stop tat from hapend!!!!
PLZ HELP!!
enemy.onEnterFrame=function(){
if(this._currentframe==10){
_root.life.nextFrame()
}
)
Whats Wrong With My Code Here?
Here's a good one for you!
I have used some code from a kirupa tutorial to load a centred html frame from flash.
This includes the foloowing action script in each button:
on (release) {
// customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = "http://www.cozmek.com/p4/ogs2eu.htm";
target_winName = "order";
width = 520;
height = 450;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 0;
resizable = 0;
// sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}
There is also some action script that is placed in a new frame on the same keyframe as the buttons:
Movieclip.prototype.openWinCentre = function (url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
getURL ("javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open('" + url + "','" + winName + "','" + "width=" + w + ",height=" + h + ",toolbar=" + toolbar + ",location=" + location + ",directories=" + directories + ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",top='+((screen.height/2)-(" + h/2 + "))+',left='+((screen.width/2)-(" + w/2 + "))+'" + "')}else{myWin.focus();};void(0);");
}
When I test this on my pc the centred window pops up perfectly.
However, when I upload the files to the server and click the buttons, absolutely nothing happens......No html frame loads!!!!
The buttons all load on level 35 in my flash movie and I need to have them load from this level as it would take months to change it all.
Does anyone know how i can overcome this major problem!!!!
By the way, I have tried using both the short version of the html link as above in the code and also I have tried using the full URL. But irrespective of that....the damn html page isn't loading at all!!!
Here's the site address to give you an idea:
http://www.picture4.me.uk
Thanks in advance folks!!!
Whats Wrong With This Code?
Code:
onClipEvent(enterFrame){
if (Key.isDown(Key.LEFT)){
this.gotoAndStop("Walking")
this._x -= speed;
this._yscale = 100
}
if (Key.isDown(Key.RIGHT)){
this.gotoAndStop("Walking")
this._x += speed;
this._yscale = -100
}
if (Key.isDown(Key.UP)){
this.gotoAndStop("Walking_up")
this._y -= speed;
}
if (Key.isDown(Key.DOWN)){
this.gotoAndStop("Walking_up")
this._y += speed;
this._rotation = 180
}
}
see whats happening is, it walks left a right perfectly and when u press up (the down isn't working like its not rotating for some reason). just try the code out urself, and watch wat happens its to hard to explain. Please tell me how to fix it
Whats Wrong With My Code?
Hey
ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing;
var popLoad:Tween = new Tween(popupMC.bgMC, "_alpha", Elastic.easeIn, 0, 80, 40, false);
popupMC.pop._visible = false;
showPopUp = function() {
if (popupMC.bgMC._alpha >= 78)
popupMC.pop._visible = true;
}
onEnterFrame = function() {
showPopUp();
trace(popupMC.bgMC._alpha )
}
hidePopup = function() {
if (popupMC.bgMC._alpha <= 78)
popupMC.pop._visible = false;
}
popupMC.pop.close.onRelease = function() {
//trace(popupMC.bgMC._alpha )
//unloadMovie(popupMC)
hidePopup();
var popUnload:Tween = new Tween(popupMC.bgMC, "_alpha", Elastic.easeOut, 80, 0, 40, false);
}
What I'm trying to do is when the fla loads the background's alpha will go from 0 to 80, then the "pop" will appear >80. How come when I trace the alpha stays at 79.6875?
Also,
When I try to hide popup, it doesn't work.
If someone can look at my code and tell me whats wrong with it, it will be a great help.
thanks vxd
Whats Wrong With This Code?
ok wen i use this code i can only use it 3 times after i use it 3 times another one of these codes destorys it self how can i stop tat from hapend!!!!
PLZ HELP!!
enemy.onEnterFrame=function(){
if(this._currentframe==10){
_root.life.nextFrame()
}
)
Whats Wrong With This Code?
Code:
if("spaceCount" > "clickCount"){
winner = "The SpaceBar!";
};
if("clickCount" > "spaceCount"){
winner = "The Mouse!";
};
It always makes the winner variable "The SpaceBar!" without the quotes. Any ideas?
Thanks,
e39m5
Whats Wrong With My Code
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="1270" height="740">
<param name="movie" value="FLASH.swf" />
<param name="quality" value="high" />
<embed src="FLASH.swf"
quality="high"
type="application/x-shockwave-flash"
width="1270"
height="740"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
Whats Wrong With My Code?
<HTML>
<HEAD><TITLE>Example</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
// a simple function that returns the value of a cookie
function getCookie(name)
{
if (document.cookie)
{
var cookies=document.cookie.split(";");
for (var i=0; i<cookies.length; i++)
{
var varName=(cookies.split("=")[0]);
var varValue=(cookies.split("=")[1]);
// the next 2 lines trim whitespaces (Netscape 7 problem)
while (varName.charAt(0)==" ")
varName=varName.substr(1,varName.length);
if (varName==name)
return varValue;
}
}
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
document.write(
'<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash...;
'+
'ID=flaMovie WIDTH=100% HEIGHT=100%> <PARAM NAME=flaMovie value="quizComponent.swf"?userName=' + getCookie('userName')">
'+
'<PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#999999>
'+
'<EMBED src="quizComponent.swf"?userName=' + getCookie('userName') quality=high bgcolor=#999999 WIDTH=100% HEIGHT=100% TYPE="application/x-shockwave-flash">
'+
' </EMBED>
'+
'</OBJECT>
');
//-->
</SCRIPT>
</BODY>
</HTML>
Whats Wrong With This Code?
hi,
I've upgraded to mx2004
when I use player 6 with the following code it works
BUT when I use player 7 it doesn't work
It must be an issue with grammer
Any suggestions would be much appreciated
Code:
MovieClip.prototype.elasticScale = function(targetS, accel, convert) {
this.step = this.step * accel + (targetS - this._xscale) * convert
this._xscale = this._yscale += this.step
}
//but actions
for(i=1;i<6;i++){
theButton=_root.menu1["but"+i];
theButton.thisNum=i;
theButton.onEnterFrame=function() {
if (_root.menu1["but"+this.thisNum].overMe) {
this.elasticScale(150, 0.7, 0.3)
} else {
this.elasticScale(100, 0.0, 0.3)
}
}
theButton.onRollOver=function(){
_root.menu1["but"+this.thisNum].overMe=true;
//bring to front
_root.menu1["but"+this.thisNum].swapDepths(5000)
}
theButton.onRollOut=function(){
_root.menu1["but"+this.thisNum].overMe=false;
}
}
Whats Wrong With This Code?
Ok, as some of you know, I've become obsessed with flash..Here's my dilemma..
Im workin on the beta alpha temporary v1.2 of a site. everything is goin good ('im tryin to learn photoshop also), except this.. I'm using seperate swf's for each page.. I used the tutorial on KIRUPA (http://www.kirupa.com/developer/mx2004/transitions.htm).. There works fine but mine wont..The code is identical..
When I click on a button, it will load the content for that button and executes the code fine, BUT when I click on a DIFFERENT button to load DIFFERENT content, it goes through the ending animation and just brings up the SAME PAGE as before..
you can check it out at www.quantumfizz.com and I have the source files zipped up, but it looks like i cant attach them in here..so if you can, give me your email addy and ill send em...
Whats Wrong With Code?
I got this code in a Flash movie that is supposed to pop up a new HTML window called info.html
1. works fine in Safari
2. does not work in IE (for mac)
3. and in Firefox it pops up the window but it also pops up a window behind it which replaces the Flash movie window.
Can this code be refined so that there are no cross-browser problems?
code:
getURL("javascript:window.open('info.html','', 'menubar=0, toolbar=0, scrollbars=yes,resizable=0, width=380, height=500')");
Please fellow flashers, help me.
Whats Wrong With This Code
ActionScript Code:
onClipEvent (enterFrame) {
framesLoaded = (Math.ceil((_parent.getBytesLoaded()/_parent.getBytesTotal())*100));
gotoAndStop(framesLoaded);
info.text = framesLoaded+"% completed";
if (framesLoaded>=90) {
_root.gotoAndPlay(2);
}
}
This is code straight from the macromedia flash mx as book. I tried the file that the give you on the cd in lesson 15/bonus/preloaderbytes.fla. I exported the file and uploaded the swf file and it does not preload.
Does the new flashplayer 7 clash with people using flash mx because of the changes in the code that they made?
Any answers would be great!
Thanks,
shaun
Whats Wrong With This Code
on (release) {
if (pass == "password") {
_root.gotoAndStop("5");
} else {
_root.gotoAndStop("1");
}
}
thats the code on a button obove the button there is a text feild with it VAR set to pass but every time i type in password it still takes me to frame 1
help!!!!!!!!!!!!!
Whats Wrong With This Code?
1046: Type was not found or was not a compile-time constant: URLLoader.
1180: Call to a possibly undefined method URLLoader.
1180: Call to a possibly undefined method URLRequest.
Code:
var xml:XML;
var xmlList:XMLList;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("gallery/images.xml"));
var xmlList = xml.children();
for (var i:Number=0; i<xmlList.length(); i++) {
for (var j:Number = 0; j<surfaceArray.length; j++) {
cube = new Cube( materials, 40, 5, 42, 10, 10, 10 );
cube.name = "cube" + i;// set instance name
trace(cube);
cube.x=Math.random() * 980 - 480;
cube.y=Math.random() * 730 - 350;
cube.z = -70;
cube.rotationZ=Math.random() * 360;
p.addChild( cube );
}
}
Whats Wrong With My Button Code?
Hi, I have a button which is supposed to load a players data into my data2 movie clip. This is the code I have on the button
on (press) {
if (length(this["players"+(code+0)])) {
_level0.data2.loadVariables("http://localhost/playerinfo.php?"+this["playersid"+(code+0)]);
}
}
when I click the button no data loads into the clip. When I test the playerinfo.php file it gets the players data fine.
So I seem to be stumped as to why the data isnt going into my movie clip...can anyone tell me if there is something wrong with my actionscript for the button?
Searcher
Whats Wrong With My Preloader Code :(
Hi All,
I have 6 external swf's that i load into a generic mc container. Scene 1 in each of the 6 external swf's contains the code below, scene 2 is the movie clip i want to play..
the preloader doesn't seem to be working (maybe it is...possibly just to fast on ADSL to see the preloader work)
would LOVE to know...( i might post this in site check too )
http://www.millenniumit.com.au
__________________________________________________ ____
_
loadPercent = (Math.floor (_root.getBytesLoaded() / _root.getBytesTotal() * 100) + "%");
loadBytes = (Math.round((_root.getBytesLoaded() / 1024) * 1000) / 1000 + " Kb of " + Math.round((_root.getBytesTotal() / 1024) * 1000) / 1000 + " Kb total Loaded.");
if (_root.getBytesLoaded() == _root.getBytesTotal()){//Check for finished loading
//If loaded, final update to fields
loadPercent = "100%";
loadBytes = (Math.round((_root.getBytesLoaded() / 1024) * 1000) / 1000 + " Kb of " + Math.round((_root.getBytesTotal() / 1024) * 1000) / 1000 + " Kb total Loaded.");
nextScene();//Where to go once your movie is loaded
}
CHeers
__________________________________________________ ____
Whats Wrong With This Xy Positioning Code?
When a movie clip hits frame 8 it automaticaly does the action below. I want it to load MEETOVER to level 2 then move it to a specific area on MEET. However the guest clip will not move to the specific coordinates. It goes up and over to the place it was created. I do not have time to redo it so that it automatically lines up. Any thoughts...
loadMovieNum("meetover.swf", 2);
setProperty("_level2", _x, "250");
setProperty("_level2", _y, "400");
stop();
Whats Wrong With This Piece Of Code?
onClipEvent (load) {
for (i=0; i<10; i++) {
this.duplicateMovieClip("ball"+i,i);
_root["ball"+i]._x=i*25;
_root["ball"+i]._y=10;
}
}
When I'm trying to execute this scrip I get this alert from Flash. "A script in this movie is causing Flash Player to run slowly..." The script is attached to a MC called "ball" and there is no other script in this movie...What's wrong? I just can't figure it out...
Arg Whats Wrong With This Code? --- Variables
ive made a button set a gobal variable..
on (release) {
_global.movie = "yes";
}
then tried to call it to run a movieclip...
if (_global.movie = "yes") {
tellTarget ("_root.image.movie") {
gotoAndPlay("nothing");
}
}
WHATS WRONG!? - (it dosent work)
help please?
cheers
Whats Wrong With This Outro Code?
hiya.
notec helped me out with some code for me to be able to do an 'outro'
button 1 :
on(release){
_level1.gotoAndPlay("outro",1);
_level1.movieName = "about.swf";
}
button 2 :
on(release){
_level1.gotoAndPlay("outro",1);
_level1.movieName = "services.swf";
}
button 3:
on(release){
_level1.gotoAndPlay("outro",1);
_level1.movieName = "portfolio.swf";
}
etc etc
any ideas what is wrong? or what i might be doing wrong as i cant get this to work.
basically im trying to load in content on several movies all loading onto level 1, each time a button is pressed i want it to play an outro scene on the current movie, then load the desired movie.
sounds simple, and every site seems to have it, but for a month now i havent been able to do it. and every code that people have given me hasnt worked. so i dont know whats going wrong
Whats Wrong With This Code? It Does Not Work:(
im using this code: on the the first frame of main timeline.
bgMusic = new Sound(mcBlank);
bgMusic.loadSound("intronismusic.mp3",false);
bgMusic.start(0,100);
myVolume = 40
bgMusic.setVolume(myVolume);
mcBlank is a blank movie clip with instance name as mcBlank.
Now when i test this file online over internet. The music does not plays at all It works perfect offline. And i've this mp3 in same folder where i've my swf.
Event when i make the isStream as True i.e
bgMusic.loadSound("intronismusic.mp3",true);
it does not plays music online.
The music is playing perfectly in local.
can anyone tell me where's it going wrong.
thanks
sam
Whats Wrong With This Code /:Mode ?
I found an old file on my machine the other day and it does a function with an input text box that I could really use now. But, when I try to use this code in a flash 8 document there are tons of errors, most having to do with the use of /:Mode or /:whatever...
on (release, keyPress "<Enter>") {
if (/:Mode eq "URL") {
/:message = "<A HREF='http://"+/:URL+"' TARGET='_blank'><U>"+/:URLMask+"</U></A>";
}
}
I removed all the /'s and :'s but now it just doesn't work.
The purpose of this code is to allow the user to type a URL in an input text box then have the url be displayed in the text field called 'message'.
Any help please?
Thanks
Whats Wrong With This Code? Should Be Simple.
This is on the root level:
var current="P1";
attachMovie(current, "prod1", 1);
prod1._x=125;
prod1._y=0;
current.play();
The Problem is at the end with the current.play();
The mc "P3" has a stop action in the first frame.
I simply want to attach it and then tell it to play.
It attaches fine but ignores the play function.
what gives?
thanks all
Not Sure Whats Wrong With My Code...any Ideas
Hi all,
I have posted this problem on another forumn but no one seems to be able to help. I have started making a quiz that generates numbers using actionscript. The idea is that everytime the generate button is pressed new values are created. Then the idea is that the students who attempt this quiz will solze for the final answer to 2 decimal places, when the student enters the answer and clicks on the check answer button they are told if it is correct or incorrect.
Now for some reason my program is saying that some of my answers, which are correct, is incorrect and I dont know why this is. For anyone who tries or can help I have posted the quiz problem for you to download. Also to make it easier I made the actual answer appear on screen so you can type it in.
Thanks
|