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








[F8] Am I Missing A Piece Of This Code?


Here is my current script: (This is the area of my script where I think I am missing something.)

//these functions decide who won

function youWin() {
if (myScore>=10) {
this.gotoAndPlay ("winningend");
}
}
function youLose() {
if (dangerScore>=10) {
this.gotoAndPlay("loosingend");
}
}
stop();



On the winning end screen and loosing end this is my code:

//this stops it from advancing
stop();
//This is the music to end the game
music_loop.stop();
music_loop.attachSound("endingMusic.wav");
music_loop.start(0,999);



If anyone can fill me in what I'm missing it would be greatly appreciated. Or if I need to look at a different area of my code or if I am doing it assbackward all together. ThanksaBunxh!!!




FlashKit > Flash Help > Flash Newbies
Posted on: 03-21-2007, 06:18 PM


View Complete Forum Thread with Replies

Sponsored Links:

A Missing Piece Of Pie....AS 2 Preloader Problem
hiya everyone!

I have created a preloader using the drawing API that basicly creates a circular wipe effect over a logo by drawing segments of a circle onto of it.

however I have a problem as my value of i (which increments the drawing position) is set to percentLoaded (after initially being 0) and this causes it to jump from 0 to 14 and all the segments in between dont get drawn therefore messing up the effect (apart from that is works great!!)

I am not sure how to make it draw the missing piece (or indeed pieces), the function that draws is called at an interval so i dont think a for loop to draw would work.....i am basicly lost now!

could someone give me a hand, give me a few pointers...once I have this i know I can extend the preloader to be less basic; i just have never been any good at drawing!!

thanks for any help, I have included the fla so you can see the problem for yourself and my code

thanks again!

View Replies !    View Related
A Missing Piece Of Pie.....AS2 Preloader Problem
hiya everyone!

I have created a preloader using the drawing API that basicly creates a circular wipe effect over a logo by drawing segments of a circle onto of it.

however I have a problem as my value of i (which increments the drawing position) is set to percentLoaded (after initially being 0) and this causes it to jump from 0 to 14 and all the segments in between dont get drawn therefore messing up the effect (apart from that is works great!!)

I am not sure how to make it draw the missing piece (or indeed pieces), the function that draws is called at an interval so i dont think a for loop to draw would work.....i am basicly lost now!

could someone give me a hand, give me a few pointers...once I have this i know I can extend the preloader to be less basic; i just have never been any good at drawing!!

thanks for any help

thanks again!

for anyone interested here is the code i am using........

function preload(preloadContent) {

// turning on and initialising the preloader
preloader_mc._visible = true;
preloader_mc.display_txt.text = "0% loaded";

//setting an interval to update the loading process
intervalID = setInterval(preloadCallback, 10, preloadContent);

}

function addSlice(O) {

x1 = r*Math.sin(O*Math.PI/180);
x2 = r*Math.sin((O+dO)*Math.PI/180);
y1 = r*Math.cos((O)*Math.PI/180);
y2 = r*Math.cos((O+dO)*Math.PI/180);

with (mask) {
moveTo(0, 0);
beginFill(0x000088);
lineTo(x1, y1);
lineTo(x2, y2);
endFill();
}
}

function preloadCallback(preloadContent) {

// initialising variables
var download:Number = 0;
var downloaded:Number = 0;
var percentLoaded:Number = 0;

// getting the current loaded and total loaded levels
download = preloadContent.getBytesTotal();
downloaded = preloadContent.getBytesLoaded();
percentLoaded = Math.ceil(downloaded / download * 100);

//updating the preloader display
preloader_mc.display_txt.text = percentLoaded + "% loaded";
trace ("i = "+i);
addSlice(dO*i);

// refreshes the display after the function is called
updateAfterEvent();

i = percentLoaded;

// checking to see if finished
if (downloaded == download && download > 0) {
// delete the interval, turn off the preloader
clearInterval(intervalID);
preloader_mc._visible = false;
gotoAndStop("startMovie");
}

}

View Replies !    View Related
Why Is The Capital Letter W Missing A Piece Of The Top Left Of It In Flash As Bitmap
Why is the capital letter W missing a piece of the top left of it in flash as bitmap text?

it's like a w with the right side Capital. Really wierd.

-Line

View Replies !    View Related
Help With A Piece Of Code
please dont think me an idiot here but I am baffled by this little piece of code... I have even referenced a couple of my actionscript books and they have it written just like I do.... here it is, can anyone tell me why it doesnt work

_level2.loadMovie("wwimenu1.swf");

or

_level2.loadMovieNum("wwimenu1.swf");

I will say that I am very tired and perhaps missing something obvious but I do not see it for the life of me

I have targeted many a movie clip and referenced the _root in this manner many times today...

_root.loadMovie("wwwimenu1.swf") works but of course that doesnt help...

Thanks for your help in advance... appreciate any feedback or any "hey you idiot that &*%$ doesnt go there..."'s

View Replies !    View Related
Favorite Piece Of Code
I'm not sure if this is the right forum, but I thought it'd be cool to post your favorite piece of code. Nothing too big. I'll start it out:


Code:
MovieClip.prototype.forward = function() {
this.onEnterFrame = function() {
//set variable to current frame
//check to see if movie has reached last frame
if (this._currentframe=="end") {
//reset variable
this.lastFrame = undefined;
delete this.onEnterFrame;
} else {
//move to next frame
this.nextFrame();
}
};
};
//play movie backwards
MovieClip.prototype.backward = function() {
this.onEnterFrame = function() {
//check to see if movie at beginning frame
if (this._currentframe==1) {
delete this.onEnterFrame;
} else {
//move to previous frame
this.prevFrame();
}
};
};


You can use this to play mcs forward and backward using forward() and backward() as commands. Forward will stop when the frame reaches a frame labeled "end". You could add a variable to the methods, indicating which frame to stop on.

View Replies !    View Related
What Is Wrong With This Piece Of... Code?
Ok...
For those that have some experience with C++ i am trying to create a structure and then create a bidimensional array using that same structure.

Code:
struct det()
{
name="";
surname="";
country="";
age="";
add="";
sex="";
}_global.det = new Array[50,50];

_global.det[1,1].name="John";
trace(_global.det[1,1].name);
But doesnt work!
How can i do that with AS???
Thanks...
Cheers.
Le.

View Replies !    View Related
[F8] Running A Piece Of Code After MC
Hi, What im trying to do is: Run a piece of code when the playhead reaches the last frame on a seperate movie clip. I understand that i need something that will recognise when the movieclip is on its last frame and call the function i have, but no idea on how to do it.

The code i'm trying to run is: (This is on its own layer on the stage)

this.onEnterFrame = function() {
if (this.black_mc._x<175) {
this.black_mc._x -= 5;
}
};


Thanks! xx

View Replies !    View Related
What Is Wrong With This Piece Of.... Code.
Hi there!
I am having some problems with my code no idea if it is logical or what is it. For some reason, when i move or access the buttons on a vertical motion, gives me the wrong coordinates. While with horizontal movement its ok.
I cracked my head and i could find why.
Trying to do a BattleShip game.

HELP!

The file is attached. Download it, and c what i am talking about.
Cheers!
Leo.

View Replies !    View Related
Small Piece Of Code Help Please
Hi, I have to following snippet:

_root.MyMovie0._y -= 10;
_root.MyMovie1._y -= 10;
_root.MyMovie2._y -= 10;
_root.MyMovie3._y -= 10;
_root.MyMovie._y -= 10;

I want to replace the "MyMovie"-values with an array. I did the following but it doesnt work.

for (i=0; i<Descriptions_length; i++) {
_root.this["MyMovie" + i]._y -= 10;
)
Anyone an idea?

cheers
Patrick

View Replies !    View Related
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...

View Replies !    View Related
Can You Explain This Simple Piece Of Code
I understand all expect on line
All comments are mine so you can check this too


onClipEvent(data){
//for every element in array _root.new
for(value in _root.dummy){
//if value is diffrent than start
if(value ne "start"){
//add element "value" to array myArray
_root.myName.push(value)
// I AM LOST
_root.myValue.push(eval(value))
}
//if value is equal start
if(value eq "start"){
//give _root.start value of element start
_root.start = eval(value);
}
}
_root.total = _root.myName.length;
}

View Replies !    View Related
A Long Piece Of Code With A Problem.. Help PLEASE
ok.. here's the situation: m tryin to make a man jump with this code. the man should keep jumping as long as i keep the spacebar pressed. but the problem is, for the first jump, the MC skips frame no. 2 to 6 and hence the jump is shortened.
the jmp MC contains animation for the actions while jumping. the actual up and down movement is generated in the code below. this code is written in the frame of the root movie. the root movie has several layers but is only one frame long.

below the code i have pasted the trace results. please please help me out. i'm stumped.

myListener.onKeyDown = function ()
{

if(Key.isDown(Key.SPACE))
{
trace("space "+jumping); //jumping is an int variable. indicates whether the man is already in air jumping(1) or not(0).
if(jumping==0)
{
trace("jumping is 0");
_root.sm._visible = false; //a MC showing standing man. irrelevant.
_root.runner._visible = false; //a MC showing running man. irrelevant.
_root.attachMovie("pjump","jmp",200);
jmp._x = manposx;
jmp._y = _root.surface._y - _root.surface._height/2 - _root.manheight - 20;
jumping = 1;
jmp.play();
trace("1.frame: "+jmp._currentframe);
}
trace("2.frame: "+jmp._currentframe);
if(jmp._currentframe>2 && jmp._currentframe<8)
{
trace(jmp._y + " frame " + jmp._currentframe);
jmp._y-=20;
trace("after "+jmp._y);
}
trace("3.frame: "+jmp._currentframe);
if(jmp._currentframe>=8)
{
jmp._y+=15;
}

trace("4.frame: "+jmp._currentframe+ " stpscl "+stopscroll);
border = jmp._y + jmp._height/2

if( border > ( surface._y - (surface._height/2) + 40) )
{
jumping = 0;
}
trace("5.frame: "+jmp._currentframe);
if(_root.opponent._x - jmp._x <700)// irrelevant
_root.attack = 1;
trace("6.frame: "+jmp._currentframe);
}
}


surface is the ground on which he stands. stuff marked irrelevant is of course, irrelevant to this problem..
the jmp movie is 10 frames long.
here's the outcome:

space 0 //ROUND ONE
jumping is 0
1.frame: 1
2.frame: 1
3.frame: 1
4.frame: 1
5.frame: 1
6.frame: 1
space 1
2.frame: 6 //THERE YOU GO..
265.4 frame 6
after 245.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 7
245.4 frame 7
after 225.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
225.4 frame 7
after 205.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
205.4 frame 7
after 185.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
379.05 surface 376.9
5.frame: 10
6.frame: 10
space 0
jumping is 0
1.frame: 1 //ROUND TWO
2.frame: 1 //EVERYTHING IS SMOOTH FROM HEREON..
3.frame: 1
4.frame: 1
5.frame: 1
6.frame: 1
space 1
2.frame: 2
3.frame: 2
4.frame: 2
5.frame: 2
6.frame: 2
space 1
2.frame: 2
3.frame: 2
4.frame: 2
5.frame: 2
6.frame: 2
space 1
2.frame: 3
265.4 frame 3
after 245.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 3
245.4 frame 3
after 225.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 3
225.4 frame 3
after 205.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 4
205.4 frame 4
after 185.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 4
185.4 frame 4
after 165.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 4
165.4 frame 4
after 145.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 5
145.4 frame 5
after 125.4
3.frame: 5
4.frame: 5
5.frame: 5
6.frame: 5
space 1
2.frame: 5
125.4 frame 5
after 105.4
3.frame: 5
4.frame: 5
5.frame: 5
6.frame: 5
space 1
2.frame: 6
105.4 frame 6
after 85.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 6
85.4 frame 6
after 65.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 6
65.4 frame 6
after 45.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 7
45.4 frame 7
after 25.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
25.4 frame 7
after 5.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
5.4 frame 7
after -14.6
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
379.925 surface 376.9
5.frame: 10
6.frame: 10
space 0
jumping is 0

and so on.. please help me..

View Replies !    View Related
Whats The AS 3.0 Equivalent Of The Following Piece Of Code?
Hi all ,
i would like to know how i could the following piece of code in AS 3.0?

Code:
this.onEnterFrame = function(){
if(variableName != undefined){
gotoAndStop(variableName);
delete onEnterFrame;
}
}


The above is in AS 2.0

Basically I want movie to go to a certain frame depending on the value of the variable and when the variable is assigned a value.

Thanks

Q

View Replies !    View Related
Translate Small Piece Of Code From C++
this is a piece of c++ code:

PHP Code:




// Apply Lenard-Jones potential force to Craft2
void DoAttractCraft2(void)
{
Vector r = Craft2.vPosition - Craft1.vPosition;
Vector u = r;
u.Normalize();
double U, A, B, n, m, d;
A = 2000;
B = 4000;
n = 2;
m = 3;
d = r.Magnitude()/Craft2.fLength;
U = -A/pow(d, n) + B/pow(d, m);
Craft2.Fa = VRotate2D( -Craft2.fOrientation, U * u);
Craft2.Pa.x = 0;
Craft2.Pa.y = Craft2.fLength / 2;
Target = Craft1.vPosition;
}







how do you translate it into as3?

View Replies !    View Related
A Long Piece Of Code With A Problem..
ok.. here's the situation: m tryin to make a man jump with this code. the man should keep jumping as long as i keep the spacebar pressed. but the problem is, for the first jump, the MC skips frame no. 2 to 6 and hence the jump is shortened.
the jmp MC contains animation for the actions while jumping. the actual up and down movement is generated in the code below. this code is written in the frame of the root movie. the root movie has several layers but is only one frame long.

below the code i have pasted the trace results. please please help me out. i'm stumped.

myListener.onKeyDown = function ()
{

if(Key.isDown(Key.SPACE))
{
trace("space "+jumping); //jumping is an int variable. indicates whether the man is already in air jumping(1) or not(0).
if(jumping==0)
{
trace("jumping is 0");
_root.sm._visible = false; //a MC showing standing man. irrelevant.
_root.runner._visible = false; //a MC showing running man. irrelevant.
_root.attachMovie("pjump","jmp",200);
jmp._x = manposx;
jmp._y = _root.surface._y - _root.surface._height/2 - _root.manheight - 20;
jumping = 1;
jmp.play();
trace("1.frame: "+jmp._currentframe);
}
trace("2.frame: "+jmp._currentframe);
if(jmp._currentframe>2 && jmp._currentframe<8)
{
trace(jmp._y + " frame " + jmp._currentframe);
jmp._y-=20;
trace("after "+jmp._y);
}
trace("3.frame: "+jmp._currentframe);
if(jmp._currentframe>=8)
{
jmp._y+=15;
}

trace("4.frame: "+jmp._currentframe+ " stpscl "+stopscroll);
border = jmp._y + jmp._height/2

if( border > ( surface._y - (surface._height/2) + 40) )
{
jumping = 0;
}
trace("5.frame: "+jmp._currentframe);
if(_root.opponent._x - jmp._x <700)// irrelevant
_root.attack = 1;
trace("6.frame: "+jmp._currentframe);
}
}


surface is the ground on which he stands. stuff marked irrelevant is of course, irrelevant to this problem..
the jmp movie is 10 frames long.
here's the outcome:

space 0 //ROUND ONE
jumping is 0
1.frame: 1
2.frame: 1
3.frame: 1
4.frame: 1
5.frame: 1
6.frame: 1
space 1
2.frame: 6 //THERE YOU GO..
265.4 frame 6
after 245.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 7
245.4 frame 7
after 225.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
225.4 frame 7
after 205.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
205.4 frame 7
after 185.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
379.05 surface 376.9
5.frame: 10
6.frame: 10
space 0
jumping is 0
1.frame: 1 //ROUND TWO
2.frame: 1 //EVERYTHING IS SMOOTH FROM HEREON..
3.frame: 1
4.frame: 1
5.frame: 1
6.frame: 1
space 1
2.frame: 2
3.frame: 2
4.frame: 2
5.frame: 2
6.frame: 2
space 1
2.frame: 2
3.frame: 2
4.frame: 2
5.frame: 2
6.frame: 2
space 1
2.frame: 3
265.4 frame 3
after 245.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 3
245.4 frame 3
after 225.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 3
225.4 frame 3
after 205.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 4
205.4 frame 4
after 185.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 4
185.4 frame 4
after 165.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 4
165.4 frame 4
after 145.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 5
145.4 frame 5
after 125.4
3.frame: 5
4.frame: 5
5.frame: 5
6.frame: 5
space 1
2.frame: 5
125.4 frame 5
after 105.4
3.frame: 5
4.frame: 5
5.frame: 5
6.frame: 5
space 1
2.frame: 6
105.4 frame 6
after 85.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 6
85.4 frame 6
after 65.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 6
65.4 frame 6
after 45.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 7
45.4 frame 7
after 25.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
25.4 frame 7
after 5.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
5.4 frame 7
after -14.6
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
379.925 surface 376.9
5.frame: 10
6.frame: 10
space 0
jumping is 0

and so on.. please help me..

View Replies !    View Related
Why This Simple Piece Of Code Isn't Working
This code should find the x,y position of the number 2 inside a multidimensional array. Now for some reason sprite.px and sprite.py always return as undefined in the trace below. I'm not entirely sure why this is happening. Any ideas?


ActionScript Code:
for (var x = 0; x<map[x].length; x++) {
        for (var y = 0; y<map.length; y++) {
            if (map[y][x] == 2) {
                trace(x);
                trace(y);
                sprite.px = x;
                sprite.py = y;
                trace(sprite.px);
                trace(sprite.py);
            }
        }
    }

View Replies !    View Related
What's Wrong With This Piece Of Code (positioning)
I'm trying to position a movieclip on the center of the stage

Code:
MC.x = (stage.width/2)-(MC.width/2);
MC.y = (stage.height/2)-(MC.height/2);
When I do this, it doesn't even get close to the center of the stage :-(

View Replies !    View Related
A Long Piece Of Code With A Problem.. Help PLEASE
ok.. here's the situation: m tryin to make a man jump with this code. the man should keep jumping as long as i keep the spacebar pressed. but the problem is, for the first jump, the MC skips frame no. 2 to 6 and hence the jump is shortened.
the jmp MC contains animation for the actions while jumping. the actual up and down movement is generated in the code below. this code is written in the frame of the root movie. the root movie has several layers but is only one frame long.

below the code i have pasted the trace results. please please help me out. i'm stumped.

myListener.onKeyDown = function ()
{

if(Key.isDown(Key.SPACE))
{
trace("space "+jumping); //jumping is an int variable. indicates whether the man is already in air jumping(1) or not(0).
if(jumping==0)
{
trace("jumping is 0");
_root.sm._visible = false; //a MC showing standing man. irrelevant.
_root.runner._visible = false; //a MC showing running man. irrelevant.
_root.attachMovie("pjump","jmp",200);
jmp._x = manposx;
jmp._y = _root.surface._y - _root.surface._height/2 - _root.manheight - 20;
jumping = 1;
jmp.play();
trace("1.frame: "+jmp._currentframe);
}
trace("2.frame: "+jmp._currentframe);
if(jmp._currentframe>2 && jmp._currentframe<8)
{
trace(jmp._y + " frame " + jmp._currentframe);
jmp._y-=20;
trace("after "+jmp._y);
}
trace("3.frame: "+jmp._currentframe);
if(jmp._currentframe>=8)
{
jmp._y+=15;
}

trace("4.frame: "+jmp._currentframe+ " stpscl "+stopscroll);
border = jmp._y + jmp._height/2

if( border > ( surface._y - (surface._height/2) + 40) )
{
jumping = 0;
}
trace("5.frame: "+jmp._currentframe);
if(_root.opponent._x - jmp._x <700)// irrelevant
_root.attack = 1;
trace("6.frame: "+jmp._currentframe);
}
}


surface is the ground on which he stands. stuff marked irrelevant is of course, irrelevant to this problem..
the jmp movie is 10 frames long.
here's the outcome:

space 0 //ROUND ONE
jumping is 0
1.frame: 1
2.frame: 1
3.frame: 1
4.frame: 1
5.frame: 1
6.frame: 1
space 1
2.frame: 6 //THERE YOU GO..
265.4 frame 6
after 245.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 7
245.4 frame 7
after 225.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
225.4 frame 7
after 205.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
205.4 frame 7
after 185.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
379.05 surface 376.9
5.frame: 10
6.frame: 10
space 0
jumping is 0
1.frame: 1 //ROUND TWO
2.frame: 1 //EVERYTHING IS SMOOTH FROM HEREON..
3.frame: 1
4.frame: 1
5.frame: 1
6.frame: 1
space 1
2.frame: 2
3.frame: 2
4.frame: 2
5.frame: 2
6.frame: 2
space 1
2.frame: 2
3.frame: 2
4.frame: 2
5.frame: 2
6.frame: 2
space 1
2.frame: 3
265.4 frame 3
after 245.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 3
245.4 frame 3
after 225.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 3
225.4 frame 3
after 205.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 4
205.4 frame 4
after 185.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 4
185.4 frame 4
after 165.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 4
165.4 frame 4
after 145.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 5
145.4 frame 5
after 125.4
3.frame: 5
4.frame: 5
5.frame: 5
6.frame: 5
space 1
2.frame: 5
125.4 frame 5
after 105.4
3.frame: 5
4.frame: 5
5.frame: 5
6.frame: 5
space 1
2.frame: 6
105.4 frame 6
after 85.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 6
85.4 frame 6
after 65.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 6
65.4 frame 6
after 45.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 7
45.4 frame 7
after 25.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
25.4 frame 7
after 5.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
5.4 frame 7
after -14.6
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
379.925 surface 376.9
5.frame: 10
6.frame: 10
space 0
jumping is 0

and so on.. please help me..

View Replies !    View Related
Flash 5-only Piece Of Code - For Player Testing
Anyone know a good piece of code that only the Flash 5 player'd recognize?

Thanks for any help
Cheers

View Replies !    View Related
Experts : Flash 5 Hates This Piece Of Code :( Why ?
hello everybody,
i dont know what is going on , i have created this piece of code with mx (it was working all ok) , but when i tried opening with flash 5 after saving as flash 5 i have faced many problems

1- there is an error in this piece of code , i cant find it this error is very irritating to flash 5 as it makes it un responding sometimes
when i check syntax i find this in the output

Line 22: 'else' encountered without matching 'if'
else if ((_root["answer1"] != _root["correctAnswer1"] && _root["answer1"] != _root["correctAnswer_alt1"]) && (_root["answer2"] != _root["correctAnswer2"] && _root["answer2"] != _root["correctAnswer_alt2"]) && (_root["answer3"] != _root["correctAnswer3"] && _root["answer3"] != _root["correctAnswer_alt3"]) && (_root["answer4"] != _root["correctAnswer4"] && _root["answer4"] != _root["correctAnswer_alt4"]) && (_root["answer5"] != _root["correctAnswer5"] && _root["answer5"] != _root["correctAnswer_alt5"])){



here u r the code , plz try to help

Code:

on (release, releaseOutside) {
for (k=1; k<maxanswers+1; k++) {
if (_root["answer"+k] == _root["correctAnswer"+k] || _root["answer"+k] == _root["correctAnswer_alt"+k]) {
//main if
//if: main if .if 2
if ((_root["answer1"] == _root["correctAnswer1"] || _root["answer1"] == _root["correctAnswer_alt1"]) && (_root["answer2"] == _root["correctAnswer2"] || _root["answer2"] == _root["correctAnswer_alt2"]) && (_root["answer3"] == _root["correctAnswer3"] || _root["answer3"] == _root["correctAnswer_alt3"]) && (_root["answer4"] == _root["correctAnswer4"] || _root["answer4"] == _root["correctAnswer_alt4"]) && (_root["answer5"] == _root["correctAnswer5"] || _root["answer5"] == _root["correctAnswer_alt5"])) {
gotoAndPlay("correctframe");
score++;
//else: main if .if 2 - else
} else {
score++;
gotoAndPlay("case3frame");
}
//else: main if _ else
} else {
//if: main if _ else .if
if (_root["answer1"]=="" && _root["answer2"]=="" && _root["answer3"]=="" && _root["answer4"]=="" && _root["answer5"]=="" )
{ _root.alertmc.gotoAndStop(2);
_root.alertmc._visible=true;
}
//if: main if _ else .if.else if
else if ((_root["answer1"] != _root["correctAnswer1"] && _root["answer1"] != _root["correctAnswer_alt1"]) && (_root["answer2"] != _root["correctAnswer2"] && _root["answer2"] != _root["correctAnswer_alt2"]) && (_root["answer3"] != _root["correctAnswer3"] && _root["answer3"] != _root["correctAnswer_alt3"]) && (_root["answer4"] != _root["correctAnswer4"] && _root["answer4"] != _root["correctAnswer_alt4"]) && (_root["answer5"] != _root["correctAnswer5"] && _root["answer5"] != _root["correctAnswer_alt5"])){
gotoAndPlay("wrongframe");
}

}
//main if end
}
// for end
}
// on release end


THANKS

View Replies !    View Related
Grab Piece Of Code From An External File?
Hello,

How do you put a small part of your actionscript, in an external file (so it can easily be changed).

For example, I want this small piece of code (in an if/than statement) to put in an external file:

clr = "0xCCCCCC"

Is this possible?

View Replies !    View Related
Flash 8 Error In Tiny Piece Of Code
Here is the error from my flash 8 output screen


**Error** Scene=entry, layer=texts, frame=1:Line 2: ')' expected
if (user add pass eq "" add "") {

**Error** Scene=entry, layer=texts, frame=1:Line 3: Statement must appear within on handler
gotoAndStop("denied", 1);

**Error** Scene=entry, layer=texts, frame=1:Line 4: Unexpected '}' encountered
} else {

Total ActionScript Errors: 3 Reported Errors: 3



Here is the actual piece of code:


on (release, keyPress "<Enter>") {
if (user add pass eq "" add "") {
gotoAndStop("denied", 1);
} else {
gotoAndPlay(2);
}
}


I am an artist not a programmer. I'm not dumb but I don't have the wonderful talent that many of you have. I make websites look good but I need your help to make them work at all. This little piece of code comes from a login script
< http://www.actionscripts.org/showMovie.php?id=576 > that I am trying to place in an swf file called login.swf. My main swf has a camtasia loader in it and on the click of a button it calls for the login.swf to open in the loader. The login.swf works great if rendered as flash 5 - 7 and by itself. It does not work if rendered as flash 8 and called into a loader in another swf. I think if this little piece of code can get fixed then flash will not say there is an error and it should work if I put this piece of code in the first frame of the login.swf

this._lockroot = true;

Any help would be appreciated. Crazy at it seems this has obsessed me for 4 nights unti 4 am. Not much sleep... I'm tired and wish I could go to bed. Please help if anyone can.

All my love and appreciation to you in advance.

Love MacJedi

View Replies !    View Related
Piece Of Code Not Working When Exported To Player 7
Greetings.

I have a preloader code that gives me easing on the loadbar which makes a pretty nice effect, BUT... only when exported to Flash Player 6 (AS2)...


Code:
onClipEvent (enterFrame) {
loading = _parent.getBytesLoaded();
total = _parent.getBytesTotal();
percentage -= (percentage-((loading/total)*100))*.25;
per1 = int(percentage);
load_bar._width = per1*1.5;
if (percentage>99) {
_parent.gotoAndPlay(2);
}
}
When i do export to Player 7 the bar doesnt move neither the movie plays to frame 2... on 6 works like a charm!

This would be fine to export always to 6 but then some other code stops working when i do it.
I'm not much into deprecated code & all, so I really cant find the cause of incompatibility.

Maybe one of you gurus knows

Thanks in advance!

Jaime

View Replies !    View Related
AS3 - Flash To Php ? Looked And Tried Every Tutorial Or Piece Of Code.
so as i am in the process of learning tu comunicate with php... i'm trying just a simple piece of code.setting 2 variables in flash and echoing them with php.


Code:
var sendr:URLLoader = new URLLoader();

var urlReq:URLRequest = new URLRequest("D:/Test/ani.php");

urlReq.method = URLRequestMethod.POST;

var variables:URLVariables = new URLVariables();

variables.user = "aName";
variables.pass = "aPass";

urlReq.data = variables;

sendr.dataFormat = URLLoaderDataFormat.VARIABLES;

sendr.load(urlReq);



<?php
$user = $_POST ['user'];
$pass = $_POST ['pass'];
function scrie ($name , $value)
{
echo $name."=".$value;
}
scrie ("$user", "$pass");

?>

i am publising the swf file from the adobe cs3.then going into php designer and testing the file.i get this at the moment (i experimented with all tutorials regarding flash to php as3 on the internet and in some cases didn't get anything as an output)

i get this when i run ani.php
=Error in my_thread_global_end(): 1 threads didn't exit


can someone point me in the right direction please ? i've staid up all night trying to make this simple job.i don't even want to think when i will try php to flash.Thank you.

View Replies !    View Related
Using One Piece Of Code To Control A Groups Colour Tween
Hi guys

I have 5 simple movie clips on the stage. When each is rolled over, it simply fades into a set (the same for all) colour over 10 frames. Then back to normal on rollout. I have a stack of these to do however, can anyone point me in the right direction for 'including' the array of clips, and targetting them to tween the simple colour rollover/out via the one piece of AS?

I'm currently using a tweening class but may even scrap that given how light on it is.

Cheers

View Replies !    View Related
Translating A Piece Of Html Code Into Actionscript For Shopping Cart
Hi all,
I am designing a website in Flash 5.0 which requires a shopping cart. I have the coded button script but only in HTML format. Was wondering if anyone was able to translate to following code into actionscript format so as i can add it into the object actions in Flash.
Here it is:
ADD TO BASKET BUTTON CODE

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com//en_AU/i/btn/x-click-but10.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="mjmspeedwayspares@bigpond.com.au">
<input type="hidden" name="item_name" value="MJM Speedway Spares">
<input type="hidden" name="amount" value="1000.00">
<input type="hidden" name="page_style" value="Primary">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="cn" value="Comment">
<input type="hidden" name="currency_code" value="AUD">
</form>
Thankyou and many thanks to whoever can help me out
Paul

View Replies !    View Related
[MX04] Scoping Help On A Piece Of Code-XML Driven Photo Gallery Loaded Into MC
I have a xml driven dynamic photo gallery. What I am trying to do is load this gallery into a MC on the main timeline so that I can control where the playback happens. The gallery works as a SWF but when I load it into a MC, it breaks and only a part loads up. Is this perhaps a scoping problem?

It does work if I let it load into a level but then it is in the wrong location. I'm guessing the MC adds a level to the scoping that I am not understanding. Help anyone?

the xml-driven gallery is a two frame FLA. The first frame has some variables and the start_mc that after loading, moves it to frame two.

Code on frame one of the XMLPhoto.FLA:


Code:
_global.a_th = 80;
_global.columns = 1;
_global.lines = 4;
var PhotoAlbum = {thumbs:[]};
photo_xml = new XML();
photo_xml.ignoreWhite = true;
stop();
code on frame two:


Code:
//QH_th is a holder MC with the same instance name
//QH_photo is a holder MC with the same instance name

photo_xml.onLoad = function() {
QH_th.html = true;
QH_th.htmlText = "<p align="center"></p>";
Photos_QuietHero(0);
};
_global.Photos_QuietHero = function(container) {
var photos = photo_xml.firstChild.childNodes;
var p_thumbs = photo_xml.firstChild.attributes.thumbs, p_photos = photo_xml.firstChild.attributes.QuietHero;
var i = container;
for (var l = 0; l<lines; l++) {
for (var c = 0; c<columns && i<photos.length; c++, i++) {
var thumb = QH_th.createEmptyMovieClip("thumb_"+i, i);
PhotoAlbum.thumbs.push(t);
thumb._y = l*a_th;
thumb.createEmptyMovieClip("photos", 1);
thumb.photos.loadMovie(p_thumbs+"/"+photos[i].attributes.thumb);
thumb.dimensions = photos[i].attributes;
thumb.onRelease = function() {
QH_photo._parent.alvo.unloadMovie();
QH_photo.dimensions = this.dimensions;
QH_photo.onEnterFrame = function() {
this._width += (this.dimensions.pixwidth-this._width)/3;
this._height += (this.dimensions.pixheight-this._height)/3;
QH_th._x = this._x+(this._width/2)+5;
QH_th._y = this._y-(this._height/2);
if (Math.round(this._width) == Math.round(this.dimensions.pixwidth) && Math.round(this._height) == Math.round(this.dimensions.pixheight)) {
this._width = this.dimensions.pixwidth;
this._height = this.dimensions.pixheight;
delete this.onEnterFrame;
this._parent.createEmptyMovieClip("alvo", 1);
this._parent.alvo._x = this._x-(this._width/2);
this._parent.alvo._y = this._y-(this._height/2);
this._parent.alvo.loadMovie(p_photos+"/"+this.dimensions.model_1);
}
};
};
}
}
};
photo_xml.load("photos.xml");
stop();
Can anyone help me with why this gallery won't load/work into a MC but does work if I load it into a level? Paths wrong, scoping wrong once it resides in a MC? Something else? Using Flash mx04/player7

View Replies !    View Related
Flash CS3, Downloading A Library Piece By Piece
When I make a new clip in a library ,or a new sound, I have an option to export it in a first frame. If I turn off that option, how can I export it later using actionscript? The problem is that a huge sound file, for example, would normally download itself before preloader has a chance to show up. So this is not a question of how can I download another file, but how can I choose which part of a swf to download first?

I hope that I don't sound too confusing.

View Replies !    View Related
Large FLA - Need To Preload Piece By Piece... Help?
I'm taking over a project that another person was doing and they laid it out in on large timeline timeline.jpg (195.79 KiB) Viewed 281 times

View Replies !    View Related
Missing Code
<html>
<head>
<title>Mix-FX</title>
<meta name="Author" CONTENT="Triple W Communications">
</head>
<body bgcolor="#000000">
<center>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#4,0,0,0" width="600" height="300">
<param name="SRC" value="mix fx 5G.swf">
<param name="quality" value="best">
<embed src="mix fx 5G.swf" pluginspage="http://www.macromedia.com/shockwave/download/" type="application/x-shockwave-flash" width="600" height="500">
</embed>
</object>
</center>
</body>
</html>

View Replies !    View Related
Missing Code Trying Again
Please e-mail me for the code,I'm new to doing this. Thanks again
<u>kjwdhunter@aol.com</u>

View Replies !    View Related
What Am I Missing In This Code?
Ok. I'm doing a pre loader that's supposed to be fun. The gist is this:
A text field [this.disp.label], font embedded, that is used as a mask for a little colorful rectangle. The bar is animated back and forth and the text changes to display percent loaded [ original, I know ]
This works fine. The text changes and everything. [ this function is called by another one that sets everything up ]

ActionScript Code:
function checkPreLoad(c) {
    this = c;
    var toLoad = this._parent[this.loadClip].getBytesTotal();
    var inLoad = this._parent[this.loadClip].getBytesLoaded();
    var per = Math.floor((inLoad/toLoad)*100);
    if (toLoad != 0 && inLoad != 0) {
        var msg = this.message+" "+per+"%";
        this.barWhole.barMask._width = per*2;
        if (per>=100) {
            this.killIntervals();
            this.initOut();
        }
    } else {
        var msg = this.message;
    }
    this.disp.label.text = msg;
    this.disp.label.embedFonts = true;
    this.disp.label.setTextFormat(loadForm);
    this.disp.label.autoSize = true;
}

However, when you reach 100%, I want it to change the text to "Done.", but it doesn't.

ActionScript Code:
function initOut() {
    this.barWhole.barMask._width = 200;
    this.colors._x = this.disp._width-this.colors._width;
    var msg = "Done.";
    //this is the but that doesn't work
    this.disp.label.text = msg;
    this.disp.label.embedFonts = true;
    this.disp.label.setTextFormat(loadForm);
    this.disp.label.autoSize = true;
    this.finish = setInterval(finishOut, 10000, this);
}

Can anyone see what's going wrong?

View Replies !    View Related
Preloader Help, Have A Look At My Code - What's Missing?
Hi

I've been using the code below to preload the whole movie but I want to preload specific scenes now (with the load bar reaching 100% when a specified scene has loaded).

Here's the code:

total_bytes = _root.getBytesTotal("Scene 1", 300);
loaded_bytes = _root.getBytesLoaded("Scene 1", 300);
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
bar.gotoAndStop(percent_done);
ifFrameLoaded ("Scene 1", 300) {
gotoAndPlay ("Scene 1", 1)

I thought putting in ("Scene 1", 300); after the total_bytes = _root.getBytesTotal and loaded_bytes = _root.getBytesLoaded would give me the remaning bytes/percent of that scene but it still shows the bytes/percent of the whole swf.

Help

Thanks

Jnr

View Replies !    View Related
This Code Is Missing A Function I Think?
Ok seeing that my last post was somewhat confusing maybe this will make sense. This is my Array:

Code:
masterMenu = ["s1Open", "s2Close", "s3Close", "s4Close", "s5Close", "s6Close",
"s7Close", "s8Close", "s9Close", "s10Close", "s11Close", "s12Close"];
And this is what I use to change my Array:

Code:
masterMenu[1]="s2Open";
masterMenu[2]="s3Open";
When I use the output screen it works fine and my Array shows the appropriate labels. I use the labels in a movie and I'm trying to play a certain frame label once I use one of these:

Code:
masterMenu[1]="s2Open";
to change it.

So do I need to make a function or something else to get the Array lables to initiate? Thanks

View Replies !    View Related
Something Silly Missing From Code
hello,
I found this code in an old post from fk member retrotron.
Im trying to get it to work on a movie clip called "myClip_mc" as the post instructed.
I must be missing something silly. heres the original link
http://www.flashkit.com/board/showth...ntrol+position


Code:


onClipEvent (enterFrame) {

function moveClip() {

if (myClip_mc._x < 400) {

// the _x value is less than 400, so increase _x by 1px,

// and let setInterval execute this function again

myClip_mc._x += 1; // move the clip 1 px to the right

} else {

// the _x value is greater than 400,

// so stop the setInterval from executing anymore

clearInterval(myInterval);

} // end "if myClip_mc._x < 400"

} // end moveClip()

// execute the "moveClip" function every 10 milliseconds

myInterval = setInterval(moveClip, 5);

}


thanks

View Replies !    View Related
Preloader Help, Check My Code - What's Missing?
Hi

I've been using the code below to preload the whole movies but I want to preload specific scenes now (with the load bar reaching 100% when a specified scene has loaded).

Here's the code:

total_bytes = _root.getBytesTotal("Scene 1", 300);
loaded_bytes = _root.getBytesLoaded("Scene 1", 300);
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
bar.gotoAndStop(percent_done);
ifFrameLoaded ("Scene 1", 300) {
gotoAndPlay ("Scene 1", 1)

I thought putting in ("Scene 1", 300); after the total_bytes = _root.getBytesTotal and loaded_bytes = _root.getBytesLoaded would give me the remaning bytes/percent of that scene but it still shows the bytes/percent of the whole swf.

I'm using MX btw.

Help

Thanks

Jnr

View Replies !    View Related
Preloader Code Problem, What Am I Missing?
I'm using the following code as a preloader, however I think I have done something wrong because it's not wroking right. It's getting to the start label but then not playing forward from there. What am I doing wrong?


Code:
onEnterFrame = function(){
var percentDone:Number = int((getBytesLoaded() / getBytesTotal()) * 100);
trace("percentDone = " + percentDone);
_root.percentDone = percentDone;
if(percentDone == 100){
trace("this is the IF");
delete onEnterFrame;
gotoAndPlay("start");
}
};

View Replies !    View Related
[CS3] HELP- Simple Button Code Missing
got the below code on 4 buttons, b1 = button 1 and so on.. 'over' is the down state. probis when u click on any other button, b2, etc the button u originally pressed stays in the down state, i need it to reset to normal state.

that make sense? i know its a simple lin eof code, but i dont know what?

b4.onRelease = over;
b4.onRollOut = out;


function over() {
this.gotoAndPlay(2);
}

function out() {
this.gotoAndPlay(7);
}

View Replies !    View Related
The Missing GotoAndLearn.com Mp3player Code
Hello there,

I was wondering if anyone here happens to have the supplementry .zip file found on gotoAndLearn.com, that accompanied the last Mp3player tutorial before the site was pulled and the content rendered unavailable.

its a bit of a long shot, but i'd thought i'd ask. I just can't find it anywhere on the web, not even http://theflashblog.com/ .

thanks Cam

View Replies !    View Related
Papervision Google Code Missing?
I've tried to download the effects branch update from google code,but found out it was missing
http://papervision3d.googlecode.com/svn/trunk/branches/
it's just cs4,no effects,or great white....
did anyone by chance download it?

View Replies !    View Related
Load .mp3 Dynamically - What's Missing In The Code?
I need help, how to make it work? Im following directions from Kirupa tutorial:
http://www.kirupa.com/developer/mx/loading.htm

sound does not load, I'm out of ideas. Please help.

(fla file in attachment, no mp3 file attached). Thanks.

View Replies !    View Related
Great Preload Code: Missing Running %
Great code from Jesse at Actionscript.org. Does anyone know why my percentage sign is missing when I use this code?

total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
bar.gotoAndStop(percent_done);
ifFrameLoaded ("Scene 2", 30) {
gotoAndPlay ("Scene 2", 1);
}


Thanks,
S27

View Replies !    View Related
Am I Missing A Code? Flash Intro Previews With Dreamweaver But Won't Load On Net
Here's the code

body>
<div align="center">
<p>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="700" height="600">
<param name="movie" value="../../Documents/flashintro.swf">

<param name="quality" value="high">
<embed src="../../Documents/Untitled-4.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="700" height="600"></embed>
</object></p>

Can anyone help? Did I forget to do something? This is my first time ever using Flash MX was there something I was supposed to do when I save the file?

View Replies !    View Related
Who Wants A Piece Of The Pie?
greetings oh inteligent ones.
i am here to ask but one humble request... PLEASE HELP ME FIGURE THIS OUT!!! i need to create a "wheel" that has it's pie pieces filled in based on a number entry... (see lovely photoshop example)



the part i am having a hard time with is that i would need the pieces to fill in as shown in example.. (from the center out). anyway, you get the point. if one could also "set" the number of pieces that would need to be filled in that would be great.

any takers?

i don't know much about action scripting, but i am willing to learn. thanks in advance.

View Replies !    View Related
HELP With This Xml Piece PLEASE
K... I'm loosing my marbles trying to figure out how to get this to work. I have a fla that loads xml and duplicates my movie clip according to the amount of xml nodes. My problem is, I can't get the xml component I made to load the xml into the fields I want. I've attached a file. Please have a look and give me some advice. Thanks!

View Replies !    View Related
Need A Piece Of AS
ok, for example, I have this buttom that itīs black, when u rollover it turns red, I want to make it return to black when u stop the rollover, but from red to black....I donīt know if I explain myself, man I suck in english, hope u understand.... whatīs a possible AS for this, a simple one.... I know there are some threads about this, but can find one, thanks

View Replies !    View Related
Need A Piece Of AS
ok, for example, I have this buttom that itīs black, when u rollover it turns red, I want to make it return to black when u stop the rollover, but from red to black....I donīt know if I explain myself, man I suck in english, hope u understand.... whatīs a possible AS for this, a simple one.... I know there are some threads about this, but can find one, thanks

View Replies !    View Related
Missing Fonts (but Not Missing)
Hi,
I'm working with MX on Mac.
I got some PC FLAs that shows the "missing fonts" error message when opened.

I searched the whole FLAs for textfields using the "missing" fonts, but there are none!
Using the movie explorer I also can't find textfields or anything using the missing fonts!

Whats going on? Are the FLAs corrupt?

View Replies !    View Related
Piece Of Cake
I have a movie in the "over" and in the "down" frames of a button (two different movies). When you click the button it plays the "down" movie like it should but then it plays the "over" movie again on release. How do I remedy this.

View Replies !    View Related
Another Piece Of Cake, But Not For Me
need html code to control the size and menu items of the browser window (I`m talking about the first browser window that pops up when you log on the website, not the url opened within the flash movie)...
please help me, all the scripts I found didn`t work

[Edited by kubko on 09-21-2001 at 10:58 PM]

View Replies !    View Related
Piece Of Cake, Right? RIGHT?
This would be one of those questions that is very easy and quick anwserd by you expert guys....

How does the load movie script works...
I want to have a movie loaded into the main movie but I want to give it an exact size and let it play....
Do you understand??

Another question is....
I have got a button when you scroll over a movie clip plays and when you press it the other movie clip (from first question) has tpo play but then the button movie clip won't play...

I KNOW I KNOW i don't work with actionscript but can anybode explain to me how I fix these problems with zction script..
If you don't understand me please say and i will clear myself up a bit (I'm not a star in English because I live in The Netherlands)

I'm waiting for a reply... thank you...

Aram

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