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




URGENT: Need Advice On Line Of Code



Hi,

I am linking a button to a getURL...
However, the company says they want to use the following as the link:
gme/sciencesymposium/

??? does it need an extension of HTML? And if so, where?
The originally had: getURL("sciencesymposium");
--BUT that does not work!

Can someone please advise me?
Thanks so very much!!

-Christine



FlashKit > Flash Help > Flash ActionScript
Posted on: 02-13-2003, 09:47 AM


View Complete Forum Thread with Replies

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

Xml Line Space Advice
Hello coders!

I'm looking for a tag or a piece of code that will help me to increase line space of bullets in xml to run in a flash presentation. I am using <li> tags but want say 50% more leading or line spacing, can anyone help?

Cheers

Simon

Changing Line Colour - Advice, Please
Hello

I am having some difficulty colouring the line which goes from left to right in my simple preloader.

I have defined the line colour (a purple shade) in the Properties panel (please see attached image) and, while the colour IS this purple shade when it begins its journey across the screen, it then changes to red!

I am attaching the FLA so that you can see what I mean. If you click on the symbol in the library and then on the forward arrow >, you can see the change of colour in the library 'preview' window.

I would like it to remain the same colour, but cannot see how to change it. Here is the Action Script (2) governing the Preloader, though it does not seem to refer to line colour:


Code:
onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int(loaded/total*100);

gotoAndStop(percent);
if (loaded == total) {
_root.gotoAndPlay(2);
}
}
Many thanks for any help.

Steve

Advice On Slow Animations On Line
Folks,

A general help point. The last two sites I've completed once uploaded have very slow animations. The animations preview locally fine, so I've increased the frame rate to get them anything like normal speed when viewed on line, so when I preview them locally the site is ridiculously fast, so it makes it hard for me to see how I'm working. The two sites don't have any massive images in them, in fact one of the things that seems to slow the animation down is masking, so I've had to remove this.

Any advice or tips for how I should be working?

Ta

Munki

Reading Code Line By Line?
Guys (and girls) im trying to write a bit of code which appears to shake an image on screen, however when i put all my _x &_y functions in to move it around it reads the whole block in one, instead of reading and DISPLAYING each line seperately... how do i force code to do it (in director Id use an 'updatestage' command) many thanks

[F8] Sound Code Does Not Work Unless It Is The Last Line Of Code?
Hi.

My code _root.sndBeep.start(); will not play a sound no matter where in my onEnterFrame function I put it, unless it is the last line of code in that function.

Anyone know how that is possible?

Example code:


PHP Code:



onEnterFrame = function(){        // Tons of code above this point not worth posting.    _root.sndBeep.start(); // This sound will never play WHY??    if (Hearts < 3 && Hearts != 0)    {                if (!bLowHealthPlaying)        {            _root.sndLowHealth.start(0,99999);            bLowHealthPlaying = true;        }    }    else    {        _root.sndLowHealth.stop();        bLowHealthPlaying = false;    }    _root.sndBeep.start(); // Yet the sound works perfectly fine here??}

Need Advice On My Code.
I have the following code:

Code:
time = 10;
easeType = mx.transitions.easing.Regular.easeOut;

endNumber = 400;
longStrip._visible = false;

button1.onRollOver = function()
{
longStrip._visible = true;
myAlphaTween = new mx.transitions.Tween(longStrip, "_alpha", easeType, 0, 100, time, false);
myXTween = new mx.transitions.Tween(longStrip, "_x", easeType, longStrip._x, endNumber, time, false);
};

longStrip.onRollOut = longStrip.onReleaseOutside = function()
{
myAlphaTween = new mx.transitions.Tween(longStrip, "_alpha", easeType, 100, 0, time, false);
myXTween = new mx.transitions.Tween(longStrip, "_x", easeType, longStrip._x, 0, time, false);
myXTween.onMotionFinished = function()
{
longStrip._visible = false;
}
}
Also, see the attached FLA.

What I want:

1. The mouse is put over the button. The a graphic moves below the button from the left. The graphic comes from an alpha of zero to 100 when it finishes moving.

2. The mouse moves outside of the graphic. The graphic moves back to where it came from and dissapears.

I have a few problems with my code.

1. The graphic moves under the button. If the mouse goes over the graphic and then goes back on the button again, the alpha tween I have gets invoed again.
To over come this, I could set a variable and then have an 'if' clause.
But, is this the best way?

2. The graphic moves under the button. When I press the mouse down, hold it down and move the mouse outside of the graphic, the graphic doesn't go back to where it came from.
I could overcome this by having a giant button or movie that covers everything except the graphic when it comes under the button.
Is this the best way?

3. If the mouse is moved over the button really fast, and outside the graphic, the graphic stays there. In intention is to have the graphic not under the button when it is outside.

Please see the FLA see the above in action.

Any help would be appreciated.

Thanks.


OM

Need Advice On My Code.
I have the following code:

ActionScript Code:
time = 10;
easeType = mx.transitions.easing.Regular.easeOut;
 
endNumber = 400;
myGraphic._visible = false;
 
button1.onRollOver = function()
{
    myGraphic._visible = true;
    myAlphaTween = new mx.transitions.Tween(myGraphic, "_alpha", easeType, 0, 100, time, false);
    myXTween = new mx.transitions.Tween(myGraphic, "_x", easeType, myGraphic._x, endNumber, time, false);
};
 
myGraphic.onRollOut = myGraphic.onReleaseOutside = function()
{
    myAlphaTween = new mx.transitions.Tween(myGraphic, "_alpha", easeType, 100, 0, time, false);
    myXTween = new mx.transitions.Tween(myGraphic, "_x", easeType, myGraphic._x, 0, time, false);
    myXTween.onMotionFinished = function()
    {
        myGraphic._visible = false;
    }
}


What I want:

1. The mouse is put over the button. The a graphic moves below the button from the left. The graphic comes from an alpha of zero to 100 when it finishes moving.

2. The mouse moves outside of the graphic. The graphic moves back to where it came from and dissapears.

I have a few problems with my code.

1. The graphic moves under the button. If the mouse goes over the graphic and then goes back on the button again, the alpha tween I have gets invoed again.
To over come this, I could set a variable and then have an 'if' clause.
But, is this the best way?

2. The graphic moves under the button. When I press the mouse down, hold it down and move the mouse outside of the graphic, the graphic doesn't go back to where it came from.
I could overcome this by having a giant button or movie that covers everything except the graphic when it comes under the button.
Is this the best way?

3. If the mouse is moved over the button really fast, and outside the graphic, the graphic stays there. In intention is to have the graphic not under the button when it is outside.

Any help would be appreciated.

Thanks.


OM

[advice On Tidying Up Code]
hi, the following works but is not very elegant and may be over scripted... (one of my re-mixes) from
http://www.flashkit.com/movies/Inter...8487/index.php
who happens to of appropriated the code himself


ActionScript Code:
Button01.onRollOver = function() {
    pt = {x:_root.map._xmouse, y:_root.map._ymouse};
    zoomIn(1, pt, 200);
};
Button01.onRollOut = function() {
    zoomOut(-1, pt, 100);
};
Button02.onRollOver = function() {
    pt = {x:_root.map._xmouse, y:_root.map._ymouse};
    zoomIn(1, pt, 300);
};
Button02.onRollOut = function() {
    zoomOut(-1, pt, 100);
};
function zoomIn(dir, pt, max) {
    this.map.onEnterFrame = function() {
        if (_root.map._xscale<max) {
            _root.map._xscale += dir*10;
            _root.map._yscale += dir*10;
            var pt2 = {x:pt.x, y:pt.y};
            _root.map.localToGlobal(pt2);
            _root.map._x -= (pt2.x-pt.x);
            _root.map._y -= (pt2.y-pt.y);
        } else {
            _root.map._xscale = max;
            _root.map._yscale = max;
        }
    };
}
function zoomOut(dir, pt, min) {
    this.map.onEnterFrame = function() {
        if (_root.map._xscale>min) {
            _root.map._xscale += dir*10;
            _root.map._yscale += dir*10;
            var pt2 = {x:pt.x, y:pt.y};
            _root.map.localToGlobal(pt2);
            _root.map._x -= (pt2.x-pt.x);
            _root.map._y -= (pt2.y-pt.y);
        } else {
            _root.map._xscale = min;
            _root.map._yscale = min;
        }
    };
}

bascically, I'd like to write one function for both zoomIn and zoomOut not unlike the original, however with the way I use it on rollOver and rollOut the problem of flaging false and true over scaling and the person moving the mouse causes a conflict.

Advice On Converting Code To As 2
Hi Everyone I got the nicest free code for movie clip buttons from this site
http://schoolofflash.com/2008/05/flash-cs3-tutorial-movie-clip-buttons/
But the code on the page how am I going to make it work in As 2? Is there maybe a recipe I can follow

I will include the code below. Please see the zip file further on the page for fla

btn1_mc.buttonMode = true;
btn2_mc.buttonMode = true;
btn3_mc.buttonMode = true;
btn4_mc.buttonMode = true;
btn1_mc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
btn1_mc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
btn2_mc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
btn2_mc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
btn3_mc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
btn3_mc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);
btn4_mc.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
btn4_mc.addEventListener(MouseEvent.ROLL_OUT, onButtonOut);

function onButtonOver(e:MouseEvent):void
{
e.currentTarget.gotoAndPlay("over");
}

function onButtonOut(e:MouseEvent):void
{
e.currentTarget.gotoAndPlay("out");
}

Thanks so much

Html Code Advice, Nothing Too Complex.
Hello clever people!

Can someone tell me the html code to add to my index page that allows my site to fit explorer without the boarder?

I currently have this:

<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"


Heres the site I want with no boarders or scroll bars

Thanks for any advice.

Need Advice From A Math Wiz .. Code Inside This Message
Hi all,

I am working on drawing a line from point to point. Since I don't know how *exactly* to this, I go and I search for stuff involving drawing lines dynamically. Wouldn't you know that because I want it, it does not exists.

(Funny thing is there is no built in way for Flash to draw runtime lines that I can find).

Anyway.. so I ran across this arctan thing in Phillip Kernmans excellent book 'Actionscripting in Flash'. (page 92 and 93 for those of you who have it). So I write a flash function that will compute the desired angle of rotation to point to the mouse. Now.. I am no math guy by any means so I just sorta made up the part that computes arctan in 360 degrees. I wanna ask the math wiz folks is there a better way to do this???


function McAngleToMouse(Mc) {

if (_root._xmouse < Mc._x ) {
arctanPlus = 180
} else {
arctanPlus = 0;
}
Mc.xdistance = (_root._xmouse - Mc._x);
Mc.ydistance = (_root._ymouse - Mc._y);
degree =
Math.atan(Mc.ydistance / Mc.xdistance)
/ (Math.PI / 180);

return degree + arctanPlus;
}

Last but not least.. I was experimenting and found that increasing the _width or _xscale properties also makes the height grow. I got around this by converting the line to a fill.

The plan of course is to draw dynamic lines by ulimately writing a function that will take the parameters x1,y1,x2,y2 and from there it will be a no brainer. Has anybody seen a good tute on how to do this?

Thanks all.

p.s. here is the code for the distance.


function DistanceBetweenPoints (x1,y1,x2,y2) {
distance = Math.sqrt( Math.pow(Math.abs(x2-x1),2) + Math.pow(Math.abs(y2-y1),2))
return distance
}



[Edited by RAMpage2010 on 10-22-2001 at 05:54 AM]

Game Advice. Combining Animation & Code
Hi, thanks in advance for any help and/or advice - it is much appreciated.

I have decided to tackle a game along the lines of:

http://news.bbc.co.uk/sportacademy/h...00/2190755.stm

As you can see, it requires kicking a rugby ball in between the posts. My question is not specific to this game - but the above game is a good example of it.

How do you coincide/intergrate animation (such as the man running) with the actual kick of the ball? I see plenty of games, that have 'set sequences' of animation, but also rely on physics and 'free movement' such as gravity or elasticity.

I was also wondering about the set up of the game. Are the goal posts actually mathmatically set along the x axis? How would kicking a ball along the z axis work?

Thanks in advance for any advice / help.

Best regards, snapple

[CS3] Advice On Organising Code / Structuring My Site
Hey peeps.
i have just updated my folio site and I am really happy with how it is looking...
http://www.joehamilton.info
but...
It was my first time creating a flash site like this and I know I did a lot of things very wrong in terms of the actionscript.
Because I was learning new bits of actionscript as I was developing the site I didn't plan things out very well.
I am hoping someone would have a moment to take a look at my files and give me some advice. Help me learn from my mistakes
I warn you that you that the files are a mess but I would appreciate any feedback if anyone could spare a couple of minutes.

A couple of things that I already know:
- I should have planned things out and used more classes
- I should have commented everything a lot better

thanks!

Guru Advice Needed: Is 75 Lines Of Code Too Much For A Clip? Prototype Better?
If any of you could give this a look I'd be grateful.

http://www.geocities.com/vegasdzl/

It uses the set.Transform method of the color object and works fine. Click anywhere and the clips randomly colorize and return to onLoad state no problem. The problem is that it requires about 75 lines of code per clip and I thought that functions would be better so I thought about prototypes. My question. Should I write new clip methods using a prototype for this or do you think keeping the code as is would be satisfactory? Any insights are appreciated. I'm not looking for any code handouts just a quick answer from those of you with guru experience and the Color object methods. Thanks to anyone who can give it a quick glance.

This Line Of Code
could some explain to me what this line of code does?


gotoAndStop((substring(getProperty("../../", _name), "2", "1") - 1) * /:row + substring(getProperty("../../", _name), "3", "1"));

i can figure out most of it just not the /:row part

never seen that syntax before.

What Does This Line Of Code Mean?
Hi,

I'm studying some code at the moment (not my own) and I came across an expression that I dont understand.


ActionScript Code:
var gs:int = (settings.vgrid && settings.barSize > 1) ? 1 : 0;

Is this some kind of if statement???

Not Complicated Just Need 1 Line Of Code
i have a button within a movie clip. if i use _root or _parent, i get _level0 (the location of the movie clip) this is all well and good, but i want a movie clip that can be duplicated multiple times, so i need to access the movie clip i have tried something along the lines of _root.this, but it hasnt worked. i dont want to specify the spesific instance of the movie clip, because then in duplication the mc's would have to have the same names and would all be affected by the buttons actions. Surely there is a command for accessing the path of the parent movie clip. Any help would be greatly appreciated.

Line-of-sight Code
I was wondering if there was a way to make a line-of-sight code. so lets say one object is moving around with a "Range" MC attached to it(could be invisible or not), how would I make it so that this MC only read what was in its Range MC and if it hit a wall, the range would only register what was between the MC and the wall. so it couldnt "see through walls".

What's Wrong With This Line Of Code?
This line of code works when I view the page locally on my box. But does not work when the site is on the server??

moXML.load("http://p.moreover.com/cgi-local/page?c=Sports%3A%20top%20stories&o=xml");

ANy suggestions?

thanx in advance,

Delete A Line Of Code
The last frame in a movie "A" uses the "loadMovie" to load movie "B" into level 2. But I want movie "A" to loop, but I need to be able to delete the "loadMovie B" actionscript.

Is there a way to delete a line on code after it has be ran? Thanks in advance..

Check This Code Please (1 Line)
ok i wish to display a result in a list box.

code:
_root.txtresult.text = _root.txtresult.text+"
"+_global.creatureObjects[counter1].name+" has "+strHas;


This displays the result in a dynamic text field fine, but i want it to display in a list box called 'result' i have tried addItem and that does not work either. Any ideas?

thanks

Just A Simple Code Line...I Think....please Help
(flash MX prof 2004)
I want a mc on my main timeline to start when you push the button on the main stage....
The code below works fine....when you push the button, the month change and starts all over....

My problem is: I need some more code on the button that start the mc....but it shal only start when Its meant to..

fx. januar 2006 = start mc frame 2 and
fx. june 2006 = start mv frame 3 and so on....

What code do I need ?? I guess it must be a "If code" and maybe I think to give the news mc a Instance name ????

Please help


I have placed a mc on the stage with 3 frames. the first is empty with a stop action. Frame 2 has a message and a stop action and so on.


I have a button with this code:


Code:
on(release)
{
month++;
if(month >= 12)
{
month=0;
year++;
}
yearField.text = year;
monthField.text = monthsArr[month];
}
and the first frame on my main timeline has this code:



Code:
month = 5;
year = 2005;
monthsArr = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];

Can't Select A Line Of Code
Hi

I'm using MX2004 on with Win XP and I have the following problem :

sometimes I can't select a line of code in the actions pane

- I can select the line before and the line after - and i can click in the line before and move the cursor down using the arrows - but i can't click on the line and select some of the code

It's not always the same line number either

has anyone else had this problem ?

Can Anyone Tell Me What This Line Of Code Means?
Hey guys,

Can anyone tell me what this line of code means?


Code:
var currentClip:MovieClip = _root.attachMovie("small", "clip"+i, i, {_y:dynamicMenu[n-1] != undefined ? startPos.y+(spacing+dynamicMenu[n-1]._height)*n : startPos.y});


I know that is attaching a movie clip to the stage called 'small' and giving it a new instance name of 'clip' + the number the counter is on. It's the bit after it that I don't get. All the colons and the question mark (?) is a bit new to me.

It would be great if you could explain this bit or point me in the right direction.

It's in relation to my earlier post

Thanks in advance,



James.

[CS3] All Good Except For One Line Of Code
I'm getting an error on this line of code, anyone have an idea what's wrong with it? I have a feeling it has something to do with __set__ and __get__ ... I'm not quite sure what those are to be honest (methods, I think?).


statusModul.__set__activeItem(++statusModul.__get_ _activeItem());


'Left side of assignment operator must be variable or property.'

Underastanding A Line Of Code...
Hi All,

I was taking a look at some code the other day, and ran into this line:

ActionScript Code:
var myVar = (com.classes.ClassA)(myMovieClip.attachMovie("MovieA", 10, {_x: 100, _y: 100}));
var myArray = new Array();
myArray.push(myVar);
com.classes.ClassA - is a Class that extends MovieClip
myMovieClip is a previously created MovieClip instance on Stage (created with createEmptyMovieClip())
Now, when I execute this code the Array Elements are undefined.

I'm not sure I understand the first line of this code. Is this instantiating ClassA then looking for myMovieClip inside? or is this just two sperate code lines? is there a purpose to this?

A little confused.
Help is appreciated.

Continue Code On Next Line
Hello,

I am all new to this actionscript and im making a flash tutorial for a software program for football trainers.

I know some programming languages like C++ so my question wont be that hard cause i know how to program

But the problem is, i am putting the Help text in a variable like this

var text = " lalalala dudududududud

djskadfjsa

"

the
is for the ENTER.

this is a example but with long texts it makes it very unclear if u put everything in one line. and i dont want to lose sight in my own code.

so i want it like this

var text = "lalalala dududududuududu

djskadfjsa"

it doesnt matter if i have to use the
again thats not a problem.

In c++ there is a command to continue code on the next line, and there is problerly one in flash too

i hope somebody knows how this works and that my question is clear

Thanks Carsten

Move A Line With Code?
Hi!

I my scene I have a movieclip called main. For main I have a file main.as, and in there I have

Code:
class main extends MovieClip {
function onLoad() {
_x = Stage.width/2;
_y = Stage.height/2;
}
}
This movieclip is the central of everything that is gonna happen in the program. The program is supposed to simulate a rope hanging in the mouse cursor, for the animating of the rope I have thought I am gonna use anchor points, say I have about 50 of them for the whole rope. Now is my question: I know you can place lines in the movieclip by using moveTo and lineTo, but can you later change the position of the endpoints for those lines? And since I want the lines to be smooth, I want to place out the direction points as well and also be able to move those too. So, does anyone have any idea of how I can performe this?

Wierd Line Of Code
I was looking at a fractal tree example, and came opon this, and didnt know what to make of it, so here it is.

ActionScript Code:
w = (level == 1) ? 9 : max_level-level+1;



If you want it in context here it is


ActionScript Code:
function growtree(level, o_x, o_y, angle, len) {    rad = Math.PI/180*angle;    var e_x = o_x+len*Math.cos(rad);    var e_y = o_y-len*Math.sin(rad);    w = (level == 1) ? 9 : max_level-level+1;    this.lineStyle(w,0xabcdef, 100);    moveTo(o_x, o_y);    lineTo(e_x, e_y);    if (level<max_level) {       for (var i = 1; i<=max_shoot; i++) {          growtree(level+1, e_x, e_y, angle+max_angle*(Math.random()*2-1), len*short_fraction);       }    } } max_angle = 60; max_level = 6; max_shoot = 4; short_fraction = .7; base_angle = 6;_root.onMouseDown = function() {    this.clear();    growtree(1, Stage.width/2, Stage.height, 90+base_angle*(Math.random()*2-1), 115); }; growtree(1, Stage.width/2, Stage.height, 90+base_angle*(Math.random()*2-1), 115);


P.S. Does kirupa have 25 line competitions like the bit-101 forums? or add a line change a line threads.Just wondering.

Weirdest Bug Ever, Only One Line Of Code.
This is the weirdest bug i've seen or either i'm just going insane.

Got a Mc with a small and simple animation, stop(); on first fram of the mc and the last.

When i tell it to gotoAndPlay(number); it gotoAndStops, it's insane.

Sounds like a simple code problem i know, but check it out, i don't think it is.

http://www.bugiam.com/test/isthisabug.fla

Explain This One Line Of Code
loadVariablesNum ("Register.php?RegName="+RegName+"&"+random(999 ), 0);

What does the random thing do?

Simple 2 Line Code Help Please
im new..and uneducated. im making an image able to drag and drop, all thats fine and dandy, but i want to close it once clicking a button attached to the image. the image name right now is called appear. so the drag and drop code goes as

on (press, dragOver) {
startDrag(_root.appear);
}
on (release, rollOut, dragOut) {
stopDrag();
}

now to make a button thats able to close the image and attach it to this item, what code would go with it?
my work would go

on (press, release) {
clear.Appear
}

doesnt work, because im new to writing actionscript i dont know the right code. please help if possible

Wierd Line Of Code
I was looking at a fractal tree example, and came opon this, and didnt know what to make of it, so here it is.

ActionScript Code:
w = (level == 1) ? 9 : max_level-level+1;



If you want it in context here it is


ActionScript Code:
function growtree(level, o_x, o_y, angle, len) {    rad = Math.PI/180*angle;    var e_x = o_x+len*Math.cos(rad);    var e_y = o_y-len*Math.sin(rad);    w = (level == 1) ? 9 : max_level-level+1;    this.lineStyle(w,0xabcdef, 100);    moveTo(o_x, o_y);    lineTo(e_x, e_y);    if (level<max_level) {       for (var i = 1; i<=max_shoot; i++) {          growtree(level+1, e_x, e_y, angle+max_angle*(Math.random()*2-1), len*short_fraction);       }    } } max_angle = 60; max_level = 6; max_shoot = 4; short_fraction = .7; base_angle = 6;_root.onMouseDown = function() {    this.clear();    growtree(1, Stage.width/2, Stage.height, 90+base_angle*(Math.random()*2-1), 115); }; growtree(1, Stage.width/2, Stage.height, 90+base_angle*(Math.random()*2-1), 115);


P.S. Does kirupa have 25 line competitions like the bit-101 forums? or add a line change a line threads.Just wondering.

Html Code For Line Break
Hiya fellow flashers, whats the html code for a line break? I would like to make a dynamic text file which has line breaks without double spacing.
PT

Move The End Of A Vector Line..WITH CODE?
hope someone cleverer than me can help me out with this little problem.

I have a little MC that moves around the stage, and i wanted to attach the end of a vector line to the MC..wherever it is on the stage. One end of the line needs to be static, and the other constantly moving (as if it were the string to a balloon, or a kite)

The MC moves around based on the user's interaction, and there fore i cannot simply animate the end point of the line, and would need to chart the center point of the MC, and attach the end of the vector line to it.

hope this makes sense. and hope that someone may be able to help me!

thanks

Line Rider Source Code
Line rider game has become very popular:
http://www.official-linerider.com/play.html
More than 17 million persons have viewed it till now. However, I did not find the source code for this game or a game similar to it anywhere in the web. I wonder if any body published the source code, if so please give a link to it.

Combining Code Into A Single Line. ?
How can I combine these lines of code into a single line. I need to clean up some of this old stuff but AS is something I'm pretty new to still.


Code:
banner.newsletter.submenu.menu.button1.mouseChildren = false;// creates the hand when mouseing over it
banner.newsletter.submenu.menu.button2.mouseChildren = false;// creates the hand when mouseing over it
banner.newsletter.submenu.menu.button3.mouseChildren = false;// creates the hand when mouseing over it
banner.newsletter.submenu.menu.button4.mouseChildren = false;// creates the hand when mouseing over it
banner.newsletter.submenu.menu.button5.mouseChildren = false;// creates the hand when mouseing over it

Convert A Line To A Fill Using Code
ok so I am trying to draw a curve and then make it into a mask, the problem is, flash only calculates the mask for a fill and thus using the line does not work. Does anyone know of a way to convert a line to a fill with as3 without using something like bitmap data as I would like to keep it as vector data if possible, below is my code:


ActionScript Code:
line = new Sprite();
this.addChild(line);
           
line.graphics.lineStyle(6,0xFFFFFF);
line.graphics.moveTo(planetX,planetY);   
line.graphics.curveTo(planetX,_mom.gsh(),_mom.gsw(),_mom.gsh()-30);

art.mask = line;

if I add a beginFill to the line, the mask works fine (but it masks the fill which i dont want)

thx in advance for any help

Flowing Line Drawing With Code
Does anyone know an easy way to draw a complex line that can move with code? I don't want any timeline animations.

I want to have a line that isn't completely rigid and can respond to movement - flowing / hovering slightly. I'm worried this could get very complicated very quickly.

Does anyone know of any libraries or packages for this kind of thing?

Single Line Of Code Not Working
Hi, I need some help with this code
Everything works except one line:

_root.mc_quecos.load_confianza.gotoAndPlay(3);

Has it something to do with the order of the lines? Is it because is a loaded movie? I'm really frustated


Code:
on (release) {
loadMovie ("confianza_out.swf", "load_confianza");

if (load_confianza.getBytesLoaded() == load_confianza.getBytesTotal()) {


_root.pan_menu.btn_confianza.rotateTo (0, 2,"easeOutElastic",0);

_root.pan_menu.btn_confianza.scaleTo (100, 2,"easeOutElastic",0);
_root.pan_menu.btn_eficiencia.scaleTo (100, 2,"easeOutElastic",0);
_root.pan_menu.btn_excelencia.scaleTo (100, 2,"easeOutElastic",0);
_root.pan_menu.btn_accion.scaleTo (100, 2,"easeOutElastic",0);
_root.pan_menu.btn_transformacion.scaleTo (100, 2,"easeOutElastic",0);
_root.pan_menu.btn_notoriedad.scaleTo (100, 2,"easeOutElastic",0);
_root.pan_menu.btn_futuro.scaleTo (100, 2,"easeOutElastic",0);

_root.principal.tabs.tab_menu.gotoAndStop(1);
_root.mc_quecos.confianza_still.gotoAndStop(2);
_root.mc_quecos.load_confianza.gotoAndPlay(3);


close_confianza._visible=false;

trace ("cargando");
} else {

trace ("testamos en ello");

}
}
Thanx for the help in advance!!

Why Is Flash Only Executing The First Line Or Code
i have 3 buttons(movieclipbuttons to be exact), each of the buttons have a animation in two sections (first one being open / second one being closed) kind of reverse animations of eac other. anyway whats happening is that as one cd goes into an open session the other two remained closed when i open up a other session (i choose between two) the home cd becomes closed which is correct. but the closing of the home cd is on the first line of the if statement. Now, if i click on the home session then it closes the other sessions like its supposed to. but if its any of the other sessions then the only session that goes back to closed state is the home session and the others just completely disappear. Im confused, why is flash only testing the first line of code and more puzzling why is it executing it even thought the value is false in certain instances. Whew, anyway here is my code

--Home Button--
on (release) {
this.gotoAndPlay("insert");
_parent.gotoAndPlay("home");
if (_parent.pictureBut._currentframe=15) {
_parent.pictureBut.gotoAndPlay("eject");
} else if (_parent.vidBut._currentframe=15) {
_parent.vidBut.gotoAndPlay("eject");
} else {
false;
}
}
--Pictures Button--
on (release) {
this.gotoAndPlay("insert");
_parent.gotoAndPlay("pictures");
if (_parent.homeBut._currentframe=30) {
_parent.homeBut.gotoAndPlay("eject");
} else if (_parent.vidBut._currentframe=15) {
_parent.vidBut.gotoAndPlay("eject");
} else {
false;
}
}
--Videos Button--
on (release) {
this.gotoAndPlay("insert");
_parent.gotoAndPlay("videos");
if (_parent.homeBut._currentframe=30) {
_parent.homeBut.gotoAndPlay("eject");
} else if (_parent.pictureBut._currentframe=15) {
_parent.pictureBut.gotoAndPlay("eject");
} else {
false;
}
}

Check out the swf

I've Gone Braindead :S. 1 Line Of Code Not Working :/
I placed this:

ActionScript Code:
this.righteye.eyeball.gotoAndPlay("look1");




On the timeline, but it doesn't play when the timeline passes that point. I made 100% sure that all the frame names and instance names are correct. I tried reaching the instance through _root.etc aswell but it didn't work either.

I then made a trace:

ActionScript Code:
trace(this);
trace(this.righteye.eyeball);




Which gave me _level0.whole and Undefined. Which is odd Cause I used that crossair to determine that targetpath. So how could it be wrong?

Source(flash8): http://hundsteg.se/Erik/creature.fla 320kb

I'm sure I've just made a stupid mistake somewhere but I cant figure it out :S.

Thanks!

Command-line Compile AS1 (-->FP6.0.65) Code?
I've been searching for a way to command-line compile (opensource-wise) AS1 code. The reason I need to do so is I've got a project that has a SWF that is compatible with the FP6.0.65 player to expose the ExpressInstall functionality, but I want to be able to let people re-compile the SWF without needing a copy of Flash.

I've looked at Ming, mtasc, and mxmlc.  I couldn't really figure out what I needed to do with Ming.  mtasc gave me errors (but I wasn't entirely certain that it couldn't work, I just didn't know how to get it to recognize the AS1 style code -- kept complaining about "System...", etc). mxmlc couldn't understand anything not in packages.

So, I was wondering if anyone can help me out.  Is there a way to command-line compile a simple, single .as file (AS1) code into a SWF targeted for FP6?
 

SCORE KEEPER - GAME - 1 LINE OF CODE
I got a advanced_score file off flashkit and everything works fine from the server to the programming except I’m having one little problem. I can’t get the final score to be put into the score keeper box it just stays at zero:

- I’m using flash 6

- the path was: Set Variable: "_level0/score:my_score" = scorevariable

- I tried that it didn’t work, so I was using: scorevariable = "_level0/score:my_score"; but it still didn't work.

- all the instances are set and the path is put in the first frame of actions in the score keeping clip

I’ve been trying for a good 3 hours of guessing how else it would work and I either get errors or just nothing changes.

Please help I used all efforts to fix this problem on this game.

The link to the game is at: http://www.sarahspetpals.com
and the link I got the score keeper at is here on flashkit at: http://www.flashkit.com/movies/Games...1904/index.php

Thanks for everyones help!

-Josh
HALO DEZIGNS

What's The HTML Code For Flash, One Line, Shortest?
What the shortest code to put in an HTML page to display a flash movie?
Just one line, no more.
Please help.

Selection.setFocus() Problem..only One Line Code Help
Hi i have an input box with an instance name message_txt on the stage.

In the actions layer the only code i have is:


Code:
Selection.setFocus("message_txt");

But when i test the movie the focus is still not in the input box..why not? I have to click in the box to be able to start typing!!

Note: ths is the only code in the movie, as i am just learning about the selection class!!


Its funny because if i put a button on stage and use the same code within i.e :


Code:
button.onRelease=function(){
Selection.setFocus("message_txt");
}
Then it sets the focus.
Ive attached the fla as well cheers

Long Lines Of Code... How Can I Drop Down A Line?
total noob question here and I'm surprised this is the first time I've encountered this but...

I have a very long line of script that I'm having to scroll far to the right in the Actions panel to modify. What's the trick for keeping the code constant but dropping it down a line for easier access?


thanks!

Splitting A Line Of Code In The Actionscript Editor
How do I split a line of code in the actionscript editor? I have a variable which contains text. In the editor, I would like to split the text into several lines of codes.
Thank you in advance for your help!!

Repeating A Line Of Code Or Infinate PrevFrame
Hey,

I'm trying to create a movie clip that can be controlled to move a shape left or right (as animated in the movie clip) via buttons on the main stage.

I was thinking I could just add prevFrame or nextFrame to the controlling buttons when the mouse rolls over them... like this:


Code:
on (rollOver) {
this.shape.prevFrame();
}


But now I need a method of repeating it non-stop while you are on the button. Can I loop the prevFrame infinatly or loop that line of code? Any ideas?

P.S I'm just getting to grips with actionscript and I'm hitting a few hurdles on the way, so please excuse my ignorance.

Al

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