Turning Around
im trying to get my one attached mc "zombie", to flip over or turn around when the oter MC "guy", is on the other side of it.i had this code on the zombie when i didn't attach it.
Code:
onClipEvent (enterFrame) {
if (_root.guy._x < _x) {
_xscale = Math.abs(_xscale);
} else {
_xscale = -Math.abs(_xscale);
}
}
but when i use this code after i attached it,
Code:
_root.zombie.onEnterFrame = function() {
if (_root.guy._x < _x) {
_xscale = Math.abs(_xscale);
} else {
_xscale = -Math.abs(_xscale);
}
};
it doesn't work....can anyone help?
FlashKit > Flash Help > Flash MX
Posted on: 07-08-2002, 01:38 AM
View Complete Forum Thread with Replies
Sponsored Links:
Turning Off An .mp3
I have a secondary .swf loading into a master .swf. I am loading an .mp3 into the secondary .swf dynamically by creating a new sound and a new sound channel (here's my vars):
ActionScript Code:
var musicPiece:Sound = new Sound(new URLRequest("mp3s/intro.mp3"));
var mySoundChannel:SoundChannel;
var isPlaying:Boolean = false;
var pos:Number = 0;
I just have a pause button in the secondary .swf and everything works fine, the problem is that I have 3 more secondary .swfs that will load when called from buttons on the master .swf. I'm unloading the new loaders that carry the .swf childern on the main timeline of the master .swf, but the sound, of course, doesn't stop. I tried just addressing the sound channel var I made:
ActionScript Code:
this.swfIntroLoader.mySoundChannel.stop();
swfIntroLoader is the loader that I created in the master .swf that loads the child .swf (secondary .swf) with the mp3 player in it.
I've also tried to cast "swfIntroLoader" as a MovieClip and that didn't work either.
Any suggestions?
View Replies !
View Related
Turning Something ...
Howdy flash people.
I can't work out how to do this, I have a MC called "dial" and I have centered it in the MC.
Now when I press on it I want it to turn with the cursor like a real dial so if I press it and turn it left it will turn left and it will turn to whereever my cursor it on the stage.
Any help would be great :D
View Replies !
View Related
Turning MC's Into Buttons?
Hello and thank you for coming! I have a question. I am dynamically loading Movieclips depending on what button a user clicks. Once these MC's are loaded, when a user rolls over this clip it is supposed to load the same MC but a larger display of it into another Movieclip. I am pretty sure I am suppose to turn these dynamic MC's into buttons. But how do I do this not knowing exactly what Movie clips will be loaded since it is based on what button the user clicks? (By the way if this helps, the SWF files are being loaded into the dynamic duplicated Movie clips.)
View Replies !
View Related
Turning Hittest Off And On...
i have a little game i'm making (just a shooty one) and when a baddie movie clip gets hit, he goes into an explosion. when the baddie is moving down the screen he is on frame 1 of his own movie clip and the hittest sends him to frame 2 and plays for 4 frames which is the graphic of him exploding.... i want the hit detect to be turned off on frame 2 of his movie so if he is exploding and hits your ship that you don't lose energy and also because as a laser hits the baddies, they goto and play frame 2 as well, but if you shoot them while they are exploding, they keep going back to and playing frame 2 which means you can keep shooting the same enemy and getting points as long as you are quick...
here is the script for the hit detection:
(spaceship is the goodie, enemy is the baddie, laser is the goodie shots at the baddie)
on the enemy:
onClipEvent (enterFrame) {
if (this.hitTest(_root.spaceship)) {
_root.hits--;
gotoAndPlay (2);
if (_root.hits==0) {
_root.gotoAndStop("gameOver");
}
}
}
on the laser:
onClipEvent (enterFrame) {
for (i=1; i<=_root.numEnemy; i++) {
if (this.hitTest(_root["enemy"+i])) {
_root.score += 100;
_root["enemy"+i].gotoAndPlay(2);
_root.spaceship.laserCounter--;
this.removeMovieClip();
}
}
}
please help cos its got me stumped... if i wasn't very clear up there, basicaly i want frame 2 of an enemy movie to take off the hittest that the onclipevent of that movie turned on...
ask me if you want to know anything that will help you help me
thanks in advance...
View Replies !
View Related
Turning A Scene Into Its Own .fla
I have a .FLA file that has about 40 scenes in it. I need to break each scene up into an individual movie so I can set a preloader up for it.
Whats the easiest way to take a scene and make it into its own .fla file? I tried highlighting all the layer names and timelines then copy and pasting and that didn't work.
Can someone help me out?
Thanks a lot!
View Replies !
View Related
Turning Var On Main TL To
Hi,
I have been succesful in sending var values from HTML to flash the "myMovie.swf?myVar=myValue" way
These vars exist on the main timeline.
Now I converted the stuf on the main timeline to a MC.
Hence, the variables are not set on that level.
So I tried two ways to convert these to:
1.) global vars:
Code:
var myVar;
Object.prototype.myVar;
2.) MC- specific vars:
('a' is the name of the MC instance)
Code:
var myVar;
a.myVar=myVar;
But when I trace() the values, nothing is there.
What am I doing wrong?
View Replies !
View Related
Turning Gif Into Button?
I am trying to make an animated gif into a button. When that image is clicked, I want it to go to a certain url. When I try to make it a button, the animation doesnt play, it just shows the first frame. It does link however. How do I make it animate, and do I need to make it into a movie clip?
View Replies !
View Related
Turning Problems
Alright I am trying to make a ship that can "turn". My current coding is this
onClipEvent (load) {
movespeed=10
}
onClipEvent (enterframe) {
if (Key.isDown(Key.RIGHT)) {
this._rotation += movespeed;
}
if (Key.isDown(Key.LEFT)) {
this._rotation -= movespeed;
}
if (Key.isDown(Key.DOWN)) {
this._y += moveSpeed;
} else if (Key.isDown(Key.UP)) {
this._y -= moveSpeed;
}
}
but all this does is rotate the ship and make it go up and down, I want to make its so the ship can turn and change direction.
For example: If the ship is facing north I want to be able to use up arrow key to make the ship go north. But If I rotate the ship so it faces east I want the up arrow key to make it go east.
View Replies !
View Related
Turning Sounds Off And On
Hello all..I have a problem. I made a button..like a speaker and want the sound on the page to go off..which is fine.. but how do you turn it back on... and off again? It's a character talking..dialog..so if it can stream and be turned off...would be good. I have the dialog in a layer..and the button. What do I do? Thx.
View Replies !
View Related
Page Turning
I have this flash movie that I'm using, but am having problems with!!
http://www.actionscript.org/showMovie.php?id=459
Whenever I add new pages, even with maxPages set to 10 (i want 10 pages), they don't show up. If someone could tell me how to get it working, it would be greatly appreciated!!
View Replies !
View Related
Pages Turning?
hey,
does anyone know how this could be accomplished??
http://www.ae.com/aestyle/
it looks like it could be pretty complex, i mean with all the shadows and stuff. plus, the turning pages and all that crap. thanks to anyone who could help me out. ive seen this done a couple times, but this was the fastest loading. thanks.
-jake
View Replies !
View Related
Turning Logo
Is it possible to create a turning logo, but only turning horizontally, so the edges of my logo won't make a greater circle then the actual logo??? Is this understandable? Pleez help!!!
View Replies !
View Related
Music - Turning On/Off
Hi
Ok i'll try not to confuse anyone with what im gonna ask so here goes.
Ive got a button called 'toogle' on a layer called 'toggle' that allows me to turn some music on and off - the music is in a sepearte movieclip called 'soundtrack' on a layer called 'soundtrack - and it works fine.
However if i turn it off, it begins to play again after one of the movieclips called 'background' within the site loops??
Below is the ActionScript im using on the button to control the music:
on (release) {
if (music == true) {
music = false;
stopAllSounds();
} else if (music == false) {
music = true;
Soundtrack.gotoAndPlay(1);
}
}
I cant understand why it begins to play again after i've turned it off? any help with this would be greatly appreciated!!
also i have a layer named actions that initialises the load sequence to the whole flash movie that includes the script:
music = true
again if anyone can help its appreciated
THANX
Ben.
View Replies !
View Related
Turning Sound Off.
I added a button that turn sound off. However, when I click onto another scene, the new sound comes on. How do you make a master sound button that turn sound off throughout a show?
I know this is probably very simple, but bear with me, I'm a newbie.
Thanks.
View Replies !
View Related
Turning Page
Hello,
I'm woking on a school project and I'm looking for a flash script that can flip your pag.
I mean a script like can be seen on http://innercity.id-t.com/
I can't find it on the tutorlials part. So if sombody can tell me where I can find sutch a script i will me verry happy.
greatz
View Replies !
View Related
Turning On And Off - Quite Simple
Hi i am trying to turn visibilty of a movie clip on if off and vice versa.
On the first frame of the scene i have put:
suit._visible = false;
I have attached this to a button:
on(release){
if(suit._visible = true){
suit._visible = false;
} else if(suit._visible = false){
suit._visible = true;
}
}
i have also tried this with _root infront off "suit".
Whats the problem?
View Replies !
View Related
Turning 86 Into 86,00 In A String... Please Help
Hi,
I'm designing an order form and use the following code to make an outcome of a calculation of "86.5" into "86.50". But how do I adjust that code to make an outcome of "86" into "86,00"? So, with both 00's AND a comma?
var myString = String(((myvar+myvar2+myvar3)*myvar5));
var Temp = myString.charAt(myString.length-2);
if (Temp == ".") {
MyString += "0";
}
perMonth.text = myString;
Thanx a lot!
View Replies !
View Related
Product Turning
does anybody know the best way to do a product turning 360 in flash. the product will be a car rim. And do you know the code for the mouse to move left or right depeding where the users mouse is
View Replies !
View Related
Turning A Pc Into A Web Server
ello people
Can anyone give me some tips/pointers or maybe a link or two on some info on how I can turn my home computer into a webserver?
I've got htis link:
www.firepages.com.au
which offers a free download package of I think apache and php
All I really want to do is serve a placeholder page and a few images. I'm running win 2k pro, can I run a server on that? I can't really install another o/s at the moment
Thanks all
[edit]what is apache btw?[/edit]
View Replies !
View Related
Turning GetCode Off?
Hey,
PHP Code:
this.onEnterFrame = function() {
c = Key.getCode();
if(c>=65){
type(c);
c = 0;
}
}
I cant see what's wrong with this code
It seems like that when I press a Key, C keeps getting the same value every time, but I only want to get that value one time when pressed...
View Replies !
View Related
Turning Off Sound
This might be posted in the wrong place - sorry!
I'm using Flash.ocx and I'd like to know if there's a way to mute all sounds in a movie using something like TSetProperty?
Many thanks,
peetm
View Replies !
View Related
Turning Movie Into B/W
hi
can i load in an external swf into a parent movie and set it to load color as B/W, regardless if they are saved as color?
i have done this trick to load jpg images, saved as swf files, into a movie for display (a photgrapher's catalog) where they needed to be changed out regularly.
any help would help...
cs
View Replies !
View Related
Turning Pages
I've got this fla where you can turn the pages of the book. When the movie loads, instead of it going to the front cover I want it to autimatically go to the first page but I can't figure out which bit of the actionscript to change. Can anyone help me?
View Replies !
View Related
Slowly Turning.
Hey freinds.
I want to make an object slowly turn towards a direction. Ive seen many tutes and forum topics about this, but I want to know the best way to do it when associated with an object turning to look at a mouse.
And it doesnt need to be...
code:
_rotation = directiontoturntowards / 2
because that is a smooth rotation... I want more of a limit on turning speed, as opposed to instant snap rotation to look at the mouse.
a code more like more like
code:
if(mouseIsClockwiseOfObject){
_rotation++
}
if(mouseIsCounterClockwiseOfObject){
_rotation--
}
thanks freinds
View Replies !
View Related
Turning One Sound Off, But Not The Other
Hi there, I read you can only have one sound object. I have a demo that has a voiceover sound, and background music. I did:
voicey = new Sound();
voicey.attachSound("chapterone");
voicey.start();
And I then I threw the bgmusic in a MC and stop it with the button. SO I can get the background music to stop and the voiceover keeps going. But when I click the off button for the voiceover it stops all the sounds. Make sense? I want to have control over both sounds.
Thanks!
View Replies !
View Related
Turning Buttons On And Off
Hello all,
I'm thinking there should be a simple answer to this: I have menu with 10 buttons, each loads a movie. What I want to do is turn off the button action of the movie that is currently loaded and then turn it back on again when another movie is loaded.
For example, if your click on the Portfolio button, the Portfolio.swf loads into level 100. While you are in the Portfolio section you can't click on the Portfolio button and load it again.
Hope this is clear. Thank you in advance
RPF
View Replies !
View Related
Turning Layers On And Off?
I'm using Flash MX.
I have an interface set up so that when a user clicks on different colored blocks around the parameter, different patterns will show up in the middle. I'd like them to click on the button to turn it on, then click on the button again to turn it off.
I don't know how to even start this. Help.
View Replies !
View Related
Turning Character Around
I want my character to turn around when he looks left or right. What his actions are:
onClipEvent (load) {
speed = 6;
}
onClipEvent (enterFrame) {
if (key.isdown(key.RIGHT)) {
play();
_rotation = 0;
_x += speed;
}
if (key.isdown(key.LEFT)) {
play();
_rotation = 0;
_x -= speed;
View Replies !
View Related
Turning Allsounds Off
hi i have a button i made and some text grouped together and i want to us it to turn an infininate loop sound on or off how do i use the actionscript commads to toggle allsounds on or off and the button itself is in different scenes from the one that the sound starts in how would i do this?
View Replies !
View Related
Help On Turning Buttons
Hi, I saw this turning buttons at http://www.sghosting.net/ and would like to do something like that too. I have tried doing it using the free transform tool in Flash MX but it does not look natural. i have attached what I have done. Hope all of you can help. You can email me at meowhaz@yahoo.com.sg Thank you.
View Replies !
View Related
Turning Pages
I am looking for a tutorial or advice on how to animate a book to give the impression of turning pages.
The concept is a photo album that will have different photos on each page, as it's flipped.
If anyone can help, or direct to where I might find help, it would be much appreciated.
Many thanks,
Jenny.
View Replies !
View Related
Turning Pages
I am looking for a tutorial or advice on how to animate a book to give the impression of turning pages.
The concept is a photo album that will have different photos on each page, as it's flipped.
If anyone can help, or direct to where I might find help, it would be much appreciated.
Many thanks,
Jenny
View Replies !
View Related
Turning Pages
Hi,
Can anyone help me? I would like to make a page turn really smootly, by the cursor dragging the top corner of each page and if You let go the page will fall back into position or if it has been turned over half way it will fall over to the next page. I have seen it done and it looks really effective.
Thanks.
Cb1
View Replies !
View Related
Turning Off Sound...HELP
Hi there!
I have an mp3 player that plays mp3's randomly in the background. It uses xml file for playlist. Now-I want to turn the sound off when you click on a link to a video page so that you can watch videos with the sound of the video playing. I used stopallsounds command and that turn off the sound but how do I turn it on again.
There are buttons on the player and the playbutton have this code attached to it:
if (playing == true)
{
gotoAndPlay(2);
}
else
{
gotoAndStop(1);
} // end if
Can I somehow call this function and that would start it again? Help would be highly appreciated....
Niklas
Here is the code of the mp3 player.
1st frame:
function scrollTitle()
{
songtitel = tracks.firstChild.childNodes[nodeNum].attributes.title;
songname_mc.songname_txt.text = songtitel + " " + songtitel;
songname_mc.songname_txt._x + songname_mc.songname_txt._width / 2 + 4 < songname_mc.songmask_mc._x ? (songname_mc.songname_txt._x = songname_mc.songmask_mc._x, songname_mc.songname_txt._x = songname_mc.songmask_mc._x) : (songname_mc.songname_txt._x--);
} // End of the function
firstLoad = true;
nodeNum = 0;
if (pause != true)
{
time = "00:00:00";
} // end if
stop();
playMusic = function ()
{
bar_mc.marker_mc._x = 0 + bar_mc.marker_mc._width / 2;
music = new Sound(this);
music.loadSound(tracks.firstChild.childNodes[nodeNum].attributes.path, true);
music.onSoundComplete = function ()
{
if (nodeNum < tracks.firstChild.childNodes.length - 1)
{
nodeNum++;
}
else
{
nodeNum = 0;
} // end if
playMusic();
};
songname_mc.songname_txt.text = tracks.firstChild.childNodes[nodeNum].attributes.title;
trace(tracks.firstChild.childNodes[nodeNum].attributes.title);
if (pause == true)
{
pausePos = Math.floor(bar_mc.marker_mc._x / barbg_mc * music.duration);
trace(pausePos);
music.start(pausePos, 0);
pause = false;
}
else
{
music.start(0, 0);
} // end if
playing = true;
gotoAndPlay(2);
volume_mc.volumefill_mc._width = music.getVolume() / volume_mc.volume_btn._width * volume_mc.volume_btn._width;
};
songname_mc.songname_txt.autoSize = true;
setInterval(scrollTitle, 70);
2nd frame
pos = new Date();
pos.setSeconds(music.position / 1000);
pos.setMinutes(music.position / 1000 / 60);
pos.setHours(music.position / 1000 / 120);
seconds = pos.getSeconds();
minutes = pos.getMinutes();
hours = pos.getHours();
if (seconds < 10)
{
seconds = 0 + seconds.toString();
} // end if
if (minutes < 10)
{
minutes = 0 + minutes.toString();
} // end if
if (hours < 10)
{
hours = 0 + hours.toString();
} // end if
time_txt.text = minutes + ":" + seconds;
3rd frame
if (playing == true)
{
gotoAndPlay(2);
}
else
{
gotoAndStop(1);
} // end if
View Replies !
View Related
[flash 8] Turning MC Into BMP
hello
i have a flash website interface which consists of a number of tabs (or pages) - all in the same swf. I want to create a nice transition effect between those pages from AS at runtime. It seems the most powerful way for this is using bitmaps and pixels (the effect i have in mind is something like the turning of a page)
So i need to be able to transform a MC on stage into a bitmap at runtime or at least a method to read all the pixels on screen and store them somewhere in order to do something with them.
Can anyone help pls?
Thanks
View Replies !
View Related
[F8] Turning The Wrong Way
http://www.verbalstreet.com/flashhelp/turn.html
Use the arrow keys. When I press right, the arrow turns until it points right, up until it points up, etc.... the problem I'm having is, when the arrow is pointing up and to the left and I press right, naturally it should turn clockwise, since it is the shorter distance to cover, but it doesn't. Same applies to when its pointing up and to the right. However, if it is pointing down, it turns in the proper direction. Here's the code
Code:
onClipEvent (load) {
function go(degree) {
if (_rotation<degree) {
_rotation += 8;
}
if (_rotation>degree) {
_rotation -= 8;
}
}
}
onClipEvent (enterFrame) {
_root.deg = go(degree)
left = Key.isDown(Key.LEFT);
right = Key.isDown(Key.RIGHT);
up = Key.isDown(Key.UP);
down = Key.isDown(Key.DOWN);
leftup = Key.isDown(Key.UP) & Key.isDown(Key.LEFT);
leftdown = Key.isDown(Key.DOWN) & Key.isDown(Key.LEFT);
rightup = Key.isDown(Key.UP) & Key.isDown(Key.RIGHT);
rightdown = Key.isDown(Key.DOWN) & Key.isDown(Key.RIGHT);
if (rightdown) {
if (_rotation>0) {
go(135);
}
if (_rotation<=0) {
go(-225);
}
}
if (leftdown) {
if (_rotation>0) {
go(225);
}
if (_rotation<=0) {
go(-135);
}
}
if (rightup) {
if (_rotation>0) {
go(45);
}
if (_rotation<=0) {
go(-315);
}
}
if (leftup) {
if (_rotation>0) {
go(315);
}
if (_rotation<=0) {
go(-45);
}
}
if (up) {
go(0);
}
if (down) {
if (_rotation>=0) {
go(180);
}
if (_rotation<0) {
go(-180);
}
}
if (right) {
if (_rotation>=0) {
go(90);
}
if (_rotation<0) {
go(-270);
}
}
if (left) {
if (_rotation>0) {
go(270);
}
if (_rotation<=0) {
go(-90);
}
}
_root.blah = _rotation;
}
Anyone know what I might do to correct this?
View Replies !
View Related
|