Slight Prob. With Actionscripts
Im making a map of our school so i made a layer that i have the map on. And then i made several movieclips with transparent gifs with small marker for different things i want to show.
On the buttons i have this AS.
on (release) {
Home._visible = !Home._visible;
}
My problem is that i dont want the movieclips to be visible when i start, so how do i make them invisible from start and then when i press a button they come visible?
FlashKit > Flash Help > Flash Newbies
Posted on: 10-16-2003, 05:51 AM
View Complete Forum Thread with Replies
Sponsored Links:
Dynamically Changing Height Of Movieclips - A Slight Prob
Hi Guys
I have a simple movieclip on my stage which has two vertical lines in both of which have their properties set to hairline. I can make the movieclip larger in height using actionscript which is no problem and works fine however the more you increase the height of the clip the thicker my two lines become. I didnt think this was an issue if the lines where set to hairline?
Anyone have any experience of this?
View Replies !
View Related
Need Slight Help Drawing Something
Hello, since I have very limited artistic skills, this is rather tough and i'm hoping someone can help me out. Anyone have any idea whats the best way to draw clouds on flash MX? My movie starts off with a view of earth from a distance, and once a button is pressed it zooms in during which the earth will be rotating until the stop frame and the end of the zoom. Also, the earth starts in the top left corner and ends in the bottom right corner. First off I'm having a hell of a time drawing clouds that look realistic on the earth, any ideas? Second, since as far as i can tell theres no way for MX to think in 3d, how would you suggest making the clouds 'rotate' around the sphere without having to draw on every frame and boosting the file size? My last question is off subject, but here goes: credit this to years of programming in non object oriented programs, but I have a hard time visualizing how flash processes variables - if one is declared in a frame, does everything in the entire program have access to it (movies, buttons, etc)? Also, if the variable is made in frame 15, do all actions from frames 1-14 have access to it? I can't really think of any reason why one would have to worry about the last question there, but it would help me understand how flash views variables a bit. Thanks!
View Replies !
View Related
Slight Problem
Alright, I have a design concept i'm doing. When a button is clicked, the movieclip (content) loads. It is supposed to fade in at 100, but it only comes up slightly faded.
Sounds confusing, I know.
Here's an example: http://reid.notthistime.com/layout.html
The code:
Code:
onClipEvent (load) {
var exists = false
this._alpha = 0
a = 0
}
onClipEvent (enterFrame) {
if (exists)
a = 100
else
a = 0;
this._alpha =+ (a-_alpha)/4
}
What am I doing wrong?
Thanks
View Replies !
View Related
Slight Problem..
Hi, hope you don't mind this question, it's just been buggine me for a while.
Basically you know those magic 8 balls you ask a question to, then shake and it gives you an answer?
Well, I'm trying to make something of that nature in flash - but while I can do the animation itself, i'm not very good on scripting..
Basically there will be a text box where you can type a question, like: Will i win the lottery on saturday..
You then click the "go" button and it will give a random answer like: yes, no etc..
If anyone knows what im talking about, and knows a way i can set it to come up with a random response whenever someone clicks the "go" button, I would be indebted if you could help
Thanks for your time.
Snake.
View Replies !
View Related
Slight Problem
Ok picture this:
A menu with multiple buttons and when you hit a button a box moves in with text in it. Then if you click the button again the text moves out
But what I want to do is when you click one button while the other text is open it will close the current box and open the second.
To do this i created a second scene and when you click the second button while the first is open it takes you to the second scene and plays the first one closing and then skips to the first scene where the second one opens.
At first it sounds like it should run smoothly but it doesn't. I created an example of what i mean and youll find out right away whats wrong.
I had to take out the stop actions for it to work.
Can someone please help me solve this. I'm sure it can be done easily but I'm very new to flash and actionscript.
Thanks
View Replies !
View Related
Dynamic MC - Slight Bug
I'm creating an image gallery where i could have anywhere between 0-12 images import via external data.
I've created a container for the images which is just a movieclip that holds a movieclip with some basic tween.
on the _root timeline i have a movieclip which is the main container -
whenever the movieclip plays it works fine but the first frame displays throughout the whole tween.. e.g small box in first frame, 2nd frame begin tween --> increase box size --> stop here. the box in the first frame doesn't remove once the tween starts.
actionscript is as follows (main timeline)
var imgContainer:MovieClip;
imgContainer.createEmptyMovieClip("instanceName",g etNextHighDepth());
instanceName.attachMovie("linkageName","newName",g etNextHighDepth());
actionscript for the movie clip with tween is:
stop();
this.onRollOver = function(){
this.gotoAndPlay(2);
}
any help appreciated.
cheers
View Replies !
View Related
Slight Help Needed
I need to know how I can pull a variable from a movieclip in my library. The movieclip that I want to pull the variable from is added to the flash file through the use of a scrollpane. Can someone help me with this?
View Replies !
View Related
Pan In - Slight Problem
Hi I've gotten this far with a little help. I have got the panning in motion to my liking but having trouble with the position of the "shape" mc. What I want is to be able to pan to the exact centre of the mc.
I want to be able to add more mc's all over the place and have it pan to the centre of every movie.
Can anyone help please.
Here's the .fla
View Replies !
View Related
Slight Problem
hi im kinda new to action scripting and i am having trouble. I want to make an animation use buttons to step it through the first 24 frames and then play the rest of the animation like normal when the button is clicked to go to the 25 frame. i know how to make buttons and how to make them step it through the animation but it dose not start the animation like normal at the 25 frame it keeps just stepping it through so i was wondering if someone could help
View Replies !
View Related
FLV Slight Skip... Any Help?
Hey guys,
I am working on a project that can be found here:
http://clients.light-power.com/RPI_flash/production
the problem is, there is a slight hiccup within the first 5 seconds or so. it doesnt always happen, but mostly in IE which is weird. here is the code i am using to load the netstream:
any thoughts?
Attach Code
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var netStream:NetStream = new NetStream(netConn);
netStream.onStatus = function(infoObject) {
if(infoObject.code == "NetStream.Play.Stop"){
gotoAndPlay("Scene 3", 1);
};
status_txt.text += "Status (NetStream)" + newline;
status_txt.text += "Level: "+infoObject.level + newline;
status_txt.text += "Code: "+infoObject.code + newline;
};
my_video.attachVideo(netStream);
netStream.setBufferTime(5);
netStream.play("RPIweb.flv");
Edited: 11/09/2007 at 06:02:08 AM by majormite
View Replies !
View Related
Slight Problem
right here we go...
i have a keyframe on frame 1, which loads a movie.
loadMovie ("movie1.swf", "holder");
then further down on the timelime, frame 107, i have another movie loading
loadMovie ("movie2.swf", "holder");
i go to test movie, and it all plays fine with one small problem, without clicking anything at all the first movie loops, therefore the you will never see the second movie, unless you right click and untick 'loop' then it all plays fine.
So, how do u have it so that loop isnt ticked in the first place?
(yeh i am a newb )
View Replies !
View Related
Slight Xml Issu
hey all,
i am building a site with 2 xml driven slideshows on the front page. when entering the site these work perfectly. however, if a user navigates around the site and then returns to the "introduction" page the slideshows start going wrong.
i guess its becasue the xml keeps being reloaded on entry to the page and then the slideshows get muddled. sometimes the images instantly reload.
so, is there a way of deleting the xml so that it loads fresh each time? or is there a better way to do such a thing?
heres the link: http://www.shoreditchlofts.com/temp/
any input - always appreciated!
thanx
h
View Replies !
View Related
Slight Problem
ive got a slight problem with a bit of codeing .the code fires perfectly in the right direction and everything but the problem is, is that the bullet speeds up every time the character fires. and also i cant get the bullet to interact with anything else
Code:
onClipEvent (load) {
sr_bullets = 0;
}
onClipEvent (enterFrame) {
function fur(s_name:String) {
duplicateMovieClip(_root.sand0, s_name, _root.enemy1.getDepth()-1);
_root[s_name]._x = _root.char._x;
_root[s_name]._y = _root.char._y;
_root[s_name]._rotation = _root.charhelp._rotation;
}
function updat_bulle_positio(s_name:String) {
_root[s_name]._y -= 1*Math.cos(_root[s_name]._rotation*(Math.PI/180));
_root[s_name]._x += 1*Math.sin(_root[s_name]._rotation*(Math.PI/180));
}
i = 0;
while (i<=sr_bullets) {
updat_bulle_positio("sand" add i);
i++;
}
if (Key.isDown(Key.SPACE)) {
sr_bullets++;
new_sname = "sand" add sr_bullets;
fur(new_sname);
}
if ("sand" add sr_bullets.hitTest(_root.enemy1)) {
_root.enemy1.gotoAndStop(15);
}
}
the game file is at
http://www.freewebs.com/shlar/samnleogame.fla
cheers
View Replies !
View Related
A Slight Problem...
This is very rookie i know but every time that I create a graphic /button it disipears...
I select it... > convert to symbol > select symbol (graphic /button) > hit enter and boom... screen goes blank. when i delete the symbol from the library i go back to the stage there it is (but as the original .gif or .jpg or whatever). Really annoying as I have in fact had this problem before but i can't remember how i resolved it!
Any help would be much appreciated...
View Replies !
View Related
Slight Problem
right here we go...
i have a keyframe on frame 1, which loads a movie.
loadMovie ("movie1.swf", "holder");
then further down on the timelime, frame 107, i have another movie loading
loadMovie ("movie2.swf", "holder");
i go to test movie, and it all plays fine with one small problem, without clicking anything at all the first movie loops, therefore the you will never see the second movie, unless you right click and untick 'loop' then it all plays fine.
So, how do u have it so that loop isnt ticked in the first place?
(yeh i am a newb )
View Replies !
View Related
Slight Problem...
I have a flash movie where you press a button to load in a text document into flash.
It works fine when i press cntrl + Enter and play it in flash.
But! when the movie is externally loaded into another flash movie it does not import the text?
code:
on (release){
loadVariablesNum("licences/England/prods/text/prod1.txt", 0);
}
very odd...
cheers
neb
View Replies !
View Related
Slight Brain Block.
Alright I'm creating a diagonal scroller. I've gotten it to scroll and everything, all I need to do now is to give it limitations to how much it scrolls. This needs to be done by making the scrollbar stop at a certain bottom position and top position. Here's the code thus far for the scrollbar.
ScrollMC
Code:
onClipEvent(load){
dodrag=false;
initx=_x;
inity=_y;
}
onClipEvent(enterFrame){
if(dodrag){
_y=_root._ymouse;
_x=initx-_y+inity;
updateAfterEvent(mouseMove);
}
}
ScrollButton (inside ScrollMC)
Code:
on(press){
dodrag=true;
tellTarget ("../") {
gotoAndPlay(2);
}
}
on (release, releaseOutside){
dodrag=false;
tellTarget ("../") {
stop();
}
}
Thanks for any help given.
View Replies !
View Related
Slight OT: Link Validator
Sorry for the Offtopic thread, but could anyone help me with this? I am mastering a very large static HTML site that could use some "dead link" checking. Is there some software that checks the whole bunch of HTML files for links that return the 404?
View Replies !
View Related
Sliding MC To X Pos...slight Problem...
Hey guys -
I have a MC that's _x is dependent on the _xmouse. What I need to happen is, when buttons are pressed inside the MC, the MC will move itself to line the clicked button up with the center of the stage.
Only problem is that I already have a onEnterFrame set up to move the dern thing based on the _xmouse. So.... I guess I need to know how to override the first onEnterFrame to give priority to this one.
View Replies !
View Related
Slight Problem With My Slideshow..
I'm having a problem with my slideshow I did the CBTcafe tutorial on creating a scrollpane slideshow and everything works fine except that when I have published the final swf it wont work unless it is located in the same folder as the other swfs and flas i.e. all the slides for the slideshow.Anyone know how to solve this problem as I would prefer to have the finished slideshow outside of this folder so you dont have to go looking for it when you open the outer folder.Thanks.
Also thanks to tsala for the original reply and link to the tutorial.Nice one..
View Replies !
View Related
I'm Having A Slight Problem With Keys
I cant get this to work, I have movement on a character and I want to be able to press the Z, X, and C keys for different actions but basically I cant get it to work, ill give you an example as i was first using the keys to movement to figure out how to get them to work:
Code:
onClipEvent (enterFrame) {
if(Key.isDown(Key.RIGHT)) {
this._x=_x+10;
} else if (Key.isDown(Key.DOWN)) {
this._y=_y+10;
} else if(Key.isDown(Key.LEFT)) {
this._x=_x-10;
} else if (Key.isDown(Key.UP)) {
this._y=_y-10;
}
}
which moves a movie clip around with the arrow keys but when I tried to replace them with letters I used these:
w=up
s=down
a=left
d=right
so the code would look like this then
Code:
onClipEvent (enterFrame) {
if(Key.isDown(Key.68)) {
this._x=_x+10;
} else if (Key.isDown(Key.83)) {
this._y=_y+10;
} else if(Key.isDown(Key.65)) {
this._x=_x-10;
} else if (Key.isDown(Key.87)) {
this._y=_y-10;
}
}
and upon doing that i get errors. So basically what im asking is how do you properly use the ASCII letter key codes in something like this?
View Replies !
View Related
Slight Newbie In Need Of Assistance
(Version being used: Flash MX 2004)
Okay, I found a tutorial on here for a matrix-esque bitstream effect, while I do not plan to use the cliche 1's and 0's, I still need it to work. I have followed the tutorial word for word and seem to be encountering some form of error as the 0 (I'm testing this out first, I will change the characters and modify accordingly after I am sure it works) does not change to a 1. Upon looking at the images provided in the tutorial, it appears Flash 5 is being used, could this affect the actionscripting in some way?
The tutorial: http://www.flashkit.com/tutorials/Sp...-152/index.php
View Replies !
View Related
[F8] Slight Preloader Problem
I have a preloader that is on the first 3 frames of all my .swf files. It works ALMOST perfectly. Everything does what it is supposed to do, but I have a "bytes loaded of bytes total" thing going, and though it appears to work, I checked and the numbers are incorrect. for example, a file that is 51 kb reads as 161, and a file that is 295kb reads as 423. I'll include my AS to help.
The first frame only acts so if you've loaded the swf already, you can bypass the preloader:
if(_root.container.getBytesLoaded() == _root.container.getBytesTotal()) {
gotoAndPlay("start");
}
//_root.container is where all the external .swfs are going... I made sure to change it for the main swf.
The second keyframe is:
var amountLoaded:Number = _root.getBytesLoaded()/_root.getBytesTotal();
var siteLoaded:Number = _root.getBytesLoaded();
var siteTotal:Number = _root.getBytesTotal();
preloader._width = amountLoaded * 400;
loadText.text = Math.round(amountLoaded * 100) + "%";
kText.text = Math.round(siteLoaded/1000) + "kb loaded / " + Math.round(siteTotal/1000) + "kb total";
//"preloader" is the actual preloader bar. loadText is the percentage loaded, which is fine. kText is the KB tracker... which is where the glitch is.
The third is:
if(_root.getBytesLoaded() == _root.getBytesTotal()) {
gotoAndPlay("start");
}
else{
gotoAndPlay(2);
}
Anything look wrong? Like I said, it seems to work fine... I could just not try to be fancy and take out the progressive KB tracker, but I'd like to include it. I'm stumped.
EDIT : I actually copied the code from 2 different movies accidentally, but my _root and _root.container are correct in their respective movies.
View Replies !
View Related
[F8] Slight Function Mess
Hi
I've been struggling with writing things as functions rather than on frames and buttons, I'm re-writing a site taking code off the frames etc and putting them as functions. I think I'm so nearly there, but I have problem with the code as follows. I think it's something to do with there being 2 onRelease functions? I know they can all be put in the same bit of code but really struggling to write it correctly. I know the big block looks scary but it applies to very small animations. I know I can write that better using "ANDS" etc but my problem is the actual structure.
if anyone can help I'll be your mate FOREVER!!!!!!!!!!!!!
The code:
stop();
nav.buttcontact.onRollOver = nav.butthow.onRollOver = nav.buttwhat.onRollOver = nav.buttwork.onRollOver = nav.buttwho.onRollOver = nav.buttnews.onRollOver = function() {;
this.playhead = "ff";
this.onEnterFrame = function() {;
if (this.playhead == "ff") {;
this.gotoAndStop(this._currentframe+1);
};
if (this.playhead == "rr") {;
this.gotoAndStop(this._currentframe-1);
};
};
};
nav.buttcontact.onRollOut = nav.butthow.onRollOut=nav.buttwhat.onRollOut=nav.b uttwork.onRollOut=nav.buttwho.onRollOut=nav.buttne ws.onRollOut=function () {
this.playhead = "rr";
};
nav.buttnews.onRelease = function() {
_root.posy = ("news");
};
nav.buttwho.onRelease = function() {
_root.posy = ("who");
};
nav.buttwork.onRelease = function() {
_root.posy = ("work");
};
nav.buttwhat.onRelease = function() {
_root.posy = ("what");
};
nav.butthow.onRelease = function() {
_root.posy = ("how");
};
nav.buttcontact.onRelease = function() {
_root.contman.gotoAndPlay(2);
_root.mean.gotoAndStop(23);
};
//I want the following block to execute when the "news", "who", "work", "what", and "how" buttons are released
nav.butthow.onRelease = nav.buttwhat.onRelease=nav.buttwork.onRelease=nav. buttwho.onRelease=nav.buttnews.onRelease=function () {
_root.p3a.gotoAndPlay(2);
_root.boxforpan3.p3b34.gotoAndPlay(2);
_root.p3b.gotoAndPlay(2);
_root.p2a.gotoAndPlay(2);
_root.boxforpan2.p2b27.gotoAndPlay(2);
_root.p2b.gotoAndPlay(2);
_root.p5a.gotoAndPlay(2);
_root.boxforpan5.p5b33.gotoAndPlay(2);
_root.p5b.gotoAndPlay(2);
_root.p6a.gotoAndPlay(2);
_root.boxforpan6a.p6b3.gotoAndPlay(2);
_root.p6c.gotoAndPlay(2);
_root.boxforpan6b.p6b2.gotoAndPlay(2);
_root.p6b.gotoAndPlay(2);
_root.p11a.gotoAndPlay(2);
_root.boxforpan11.p11b1.gotoAndPlay(2);
_root.p11b.gotoAndPlay(2);
_root.p7a.gotoAndPlay(2);
_root.boxforpan7.p7b10.gotoAndPlay(2);
_root.p7b.gotoAndPlay(2);
_root.p8a.gotoAndPlay(2);
_root.boxforpan8.p8b4.gotoAndPlay(2);
_root.p8b.gotoAndPlay(2);
_root.nav.gotoAndPlay(2);
_root.head.gotoAndPlay(2);
_root.manp3top._visible = false;
_root.manp11top._visible = false;
_root.manp5top._visible = false;
_root.manp2side._visible = false;
_root.manp2top._visible = false;
_root.contman._visible = false;
_root.mean._visible = false;
_root.mean.gotoAndStop(23);
};
View Replies !
View Related
Slight Legal Queston
if i grab a gif of (for example) a sprit walking (like in a rpg game) and i make a game out of this and DO NOT charge to play, Do Not sell, or claim that i created it do i need to give props to who created the gif file?
View Replies !
View Related
Slight Jitter With Jpgs
well i would say tak e a look at my fla buuuttt its not letting me upload it so i shall try to explain the problem in more detail since iv read the solution on this site and know it is simple.
i have two jpgs blend into eachother using alpha settings. as in one jpg goes from 0-100 alpha and the other goes from 100-0 making them look like they morph to eachother. anyhow. in the middle of tweening part of the jpg with jitter or shake just slightly alltho all the jpgs are lined up perfectly.
-thanks
View Replies !
View Related
A Slight Problem With Actionscript
Hello all. I am in a bit of a hole. Ok so the thing is i have my main timeline with the content and i also have buttons and now beside these buttons i have a movie clip now what i am trying to do is when i rollover these buttons they would have a new image appear accordingly. So i basically need to target the movie clip and for each button to go to a different area of the movie clip's timeline. I have tried
on (release) {
targetPath(pic7_mc);
gotoAndPlay(frame2);
}
and
on (release) {
tellTarget(pic7_mc);
gotoAndPlay(frame2);
}
but these are not correct and its been a while since i have done any actionscript. Any help would greatly be appreciated.
View Replies !
View Related
Slight Problem With Preloader
please have a look at :
http://www.brineleas.co.uk/sample/index.html
its a site I am currently in development for a school. However I have modified my preloader, but it does not seem to fully reach the other end of the bar. Yes the bar has been modified and extended, but surely the principles are still the same as before.
Can anyone explain why I am having this slight problem?
Trev
View Replies !
View Related
Slight Jitter With Jpgs
well i would say tak e a look at my fla buuuttt its not letting me upload it so i shall try to explain the problem in more detail since iv read the solution on this site and know it is simple.
i have two jpgs blend into eachother using alpha settings. as in one jpg goes from 0-100 alpha and the other goes from 100-0 making them look like they morph to eachother. anyhow. in the middle of tweening part of the jpg with jitter or shake just slightly alltho all the jpgs are lined up perfectly.
-thanks
View Replies !
View Related
Slight Preloading Problem
Hey guys,
I just finished up a site that used multiple swf.'s loaded into the main swf. to form the pages. Thing is, in each of the page swf.'s loaded, theres a scene that preloads the main content. When I access a page on the site the swf. preloads itself and then the content is revealed. But, if you leave that page and re-visit it, it preloads a second time. I wanted to know if there was a way to code it so that it preloaded once and when you revisited that page the content would already be there since it was preloaded the first time you went there.
If you want to take a look at what I mean, the site can be found here, www.entity90.com
thanks
View Replies !
View Related
Slight Light Rectangle Around Png
Hello there!
exported from photoshop trough "save for web" as 24 bit png. appears in flash with slight light rectangle in size of object. can anyone foreced same problem?
maybe there is better way to export shaped, transparent bitmaps for animation in flash?
thnx in advance
View Replies !
View Related
A Slight Modfication To This Code
hi i was wondering if any one can perhaps show me what needs to be added to code in order for it to bounce like this specific site..http://www.otradesign.com/flash-index.htm
i have the code to change frame sizes but would like to add the elasticty or the bounce at the end. can anyone give me a hand with this or forward me to any sort of code that i can insert the code into what i have here..many thanks!
chris
View Replies !
View Related
Actionscripts?
im pritty new to flash mx (infact i only got it 5 days ago) and i have been doing the tutorials on flashkit.com. In the tutorial it keeps saying things like "insert action script in the actionscript propertys blablalablalblablabla ect." Is actionscript important? Do i need to learn it? Where can i learn it? Any tutorials?
View Replies !
View Related
ActionScripts.txt
vertex = function (x, y, z) {
this.x = x;
this.y = y;
this.z = z;
};
vertex.prototype.rotateXY = function(sinX, cosX, sinY, cosY) {
//rotation around of axes X and Y
var yp = this.y*cosY-this.z*sinY;
var zp = this.y*sinY+this.z*cosY;
var xp = this.x*cosX+zp*sinX;
var zp = -this.x*sinX+zp*cosX;
this.x = xp;
this.y = yp;
this.z = zp;
};
vertex.prototype.perspective = function() {
//calculation 3d to 2d
var perRatio = 1/(this.z/dist+1);
this.rx = cnx+this.x*perRatio;
this.ry = cny+this.y*perRatio;
};
face = function (c, v1, v2, v3, v4) {
this.c = c;
this.v1 = v1;
this.v2 = v2;
this.v3 = v3;
this.v4 = v4;
};
face.prototype.draw = function() {
var shadow = 140+((v[this.v1].rx+v[this.v2].rx+v[this.v3].rx+v[this.v4].rx)-(v[this.v1].ry+v[this.v2].ry+v[this.v3].ry+v[this.v4].ry))/4;
_root.lineStyle(0, 0x000000, 100);
_root.beginFill(shadow << 16 | shadow << 8 | shadow << 0, 100);
_root.moveTo(v[this.v1].rx, v[this.v1].ry);
_root.lineTo(v[this.v2].rx, v[this.v2].ry, v[this.v3].rx, v[this.v3].ry);
_root.lineTo(v[this.v3].rx, v[this.v3].ry, v[this.v4].rx, v[this.v4].ry);
_root.lineTo(v[this.v4].rx, v[this.v4].ry, v[this.v1].rx, v[this.v1].ry);
_root.endFill();
};
face.prototype.fill = function() {
var vis = ((v[this.v2].rx-v[this.v1].rx)*(v[this.v3].ry-v[this.v1].ry)-(v[this.v2].ry-v[this.v1].ry)*(v[this.v3].rx-v[this.v1].rx));
if ((this.c+2)%2) {
vis *= -1;
}
if (vis>=0) {
this.draw();
}
};
_root.onLoad = function() {
cnx = 250;
cny = 250;
dist = 200;
var sx = 75;
var sy = 75;
var sz = 75;
rad = Math.PI/180;
amount = 7;
// initialization of the vertex
v = new Array();
v[0] = new vertex(sx, -sy, sz);
v[1] = new vertex(sx, sy, sz);
v[2] = new vertex(sx, sy, -sz);
v[3] = new vertex(sx, -sy, -sz);
v[4] = new vertex(-sx, -sy, -sz);
v[5] = new vertex(-sx, sy, -sz);
v[6] = new vertex(-sx, sy, sz);
v[7] = new vertex(-sx, -sy, sz);
// initialization of the faces
f = new Array();
f[0] = new face(0, 0, 1, 2, 3);
f[1] = new face(1, 2, 3, 4, 5);
f[2] = new face(2, 4, 5, 6, 7);
f[3] = new face(3, 0, 1, 6, 7);
f[4] = new face(4, 0, 3, 4, 7);
f[5] = new face(5, 1, 2, 5, 6);
};
// ################################################## ##
// -- © 2002-2003 Grigory Ryabov.
// -- http://www.flash.plux.ru
// ################################################## ##
this.onEnterFrame = function() {
var xa = -(cnx-_ymouse)*rad/25;
var ya = (cny-_xmouse)*rad/25;
var sinY = Math.sin(ya);
var cosY = Math.cos(ya);
var sinX = Math.sin(xa);
var cosX = Math.cos(xa);
for (var i = 0; i<=amount; i++) {
v[i].rotateXY(sinY, cosY, sinX, cosX);
v[i].perspective();
}
_root.clear();
// fill the right side face
f[0].fill();
// fill the front face
f[1].fill();
// fill the left side face
f[2].fill();
// fill the back face
f[3].fill();
// fill the bottoms face
f[4].fill();
// fill the top face
f[5].fill();
};
stop();
View Replies !
View Related
Help With Actionscripts
I am designing a game and I have a dynamic text box with the variable named power. Throughout the game the number in this box will rise. For an enemy in the game I will have a health bar that will decline as the enemy gets hit. How can i use the number in the power text box to determine how much the health bar will decline. Please give me an example of a script. It will be greatly appreciated.
Thanks,
Chad Conger
View Replies !
View Related
Help Me On Actionscripts
I have figured out how to use "HitTest".
but I have a game I'm making, and I made an invisable moveclip, and when my player goes on it or "hitTest" it. Then it will move to the next frame and play...
could someone help me wih this problem...
here is my code:
If _root.player, HitTest (_root.object2) then
telltarget "?my movie"
gotostop "56"
but I want to know how do you tell the movie to move to a specific frame?
that only thing I know is how to tell a moveclip to move a specific frame inside of it.
how do you tell the movie to move...
View Replies !
View Related
Actionscripts
How can I trace Fps for the movie with actionscript?
How can I trace Cpu for the movie with actionscript?
I have seen this in other flash movies/games and wonder
how it is done..
View Replies !
View Related
Actionscripts
hello,
i am new at this flash thing. heres the situation. I have a looped from frame, say, 135 to 195 - i.e. the movie plays within these frames. I have written an action script to jump to frame 196 on a button click. simple so far. the trouble is once it reaches the 196th frame, the movie doesnt display anything even though there are clips and objects beyond it.
i have been at it for hours and cant figure out why does it not display the clips beyond 196. help!
View Replies !
View Related
Slight Flicker Inbetween Loading .swf's
i ve got a movie that loads multiple external .swf's at separtate times. when 1 finishes and the next plays there is a slight flicker that is too noticeable!
this is really annoying as i ve built this entire thing thinking it would seamlessly connectwith each other.
can u help?
thx
View Replies !
View Related
MC Resize Quickie (slight Return)
OK so I have a grid made of several instances of a square mc. The rectangle shrinks in width as the mouse moves away from it along the x axis, and shrinks in height as the mouse moves away along the y axis.
Now what I'd like to do is get the rectangle to also shrink in height as the mouse moves along the x axis, I've commmented out an example of the code that should do this, unfortunately it only does this if the mouse is exactly at 1 on the x axis.
Swf and Fla htttp://www.cursive.co.uk/size
Code:
rate = 4;
yrate = 4;
xmouselimit = 250;
ymouselimit = 350;
if (_xmouse>1 && _xmouse<xmouselimit ) {
square._width = (400-_xmouse)/rate;
//square._height = (300-_xmouse)/rate;
}
if (_xmouse<-1 && _xmouse>-xmouselimit) {
square._width = (400+_xmouse)/rate;
}
if (_ymouse>1 && _ymouse<ymouselimit) {
square._height = (300-_ymouse)/yrate;
}
if (_ymouse<-1 && _ymouse>-ymouselimit) {
square._height = (300+_ymouse)/yrate;
}
View Replies !
View Related
Sliding Menu...Slight Modification
Hello, this is my first post. I hope someone can help me. I have a flash menu (built in flash mx) and when a menu tab is clicked, it expands and contracts (it slides) vertically which opens up sub menu tabs. It's really nice. However, I need to make the last menu tab to stay expanded all the time (onload, without having to use the release event) and of course it would have "move up and down" with the other menu tabs when they are clicked. I've placed the flash menu in a zip file. Can someone please take a look at it and tell me how I would be able to do it.
Thanks and here is the location of the zip file (also uploaded here):
https://www.cfsecure.net/aah/menu/Flash_SliderMenu.zip
View Replies !
View Related
Custom Scrollbar Slight Error
Hi
I found this great piece of source:
http://www.flashkit.com/board/showth...tal+scrollbars
But I want to scroll on mouse over, rather than press and it needs to stop once you move the mouse off. I have almost got it by using rollover and rollout but it slightly goes wrong at the end and keeps scrolling if you put it over. It doesnt seem to know it has to stop.
For instance when you start with the image scroller you dont want to scroll right, you would go left. But actually you can hover over the right button and it moves just once. You can then move mouse off and back on and it moves once and this isnt a good idea because people may think its broke.
Attachment has my version in it (I noticed the original also moves to the right if you click it, so it has the same problem)
View Replies !
View Related
Loading Items With A Slight Delay Between Each
Flash 8:
I have several buttons I am creating when loading from an XML document that contains their data. The clips all load and work well, but because there are many of them in a vertical row, I thought it would be interesting to load each one with a fade. So, I fade them in as I slide them to the left, which works fine, but they all do this at the same time.
Is there a way for me to somehow have the clips wait a bit before they start their own timeliness so there is a 1/2 second pause or something between items?
Because all of the clips are created at the start of the movie, I assume my solution must be in the time line for the individual clip instance.
I am lost as to the best method to do this. Thoughts?
View Replies !
View Related
|