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




Navigation Code Help Please



Hi,

Does anyone have any ideas on how I can get one of the boxes in this navigation to go back to its original state after another navigation box is clicked? Any help or ideas would be much appreciated.

Thanks,

Chris

SWF File: http://68.43.100.174/Design%20Runway/slide.swf

Flash File: http://68.43.100.174/Design%20Runway/slide.fla



FlashKit > Flash Help > Flash General Help
Posted on: 08-20-2004, 07:55 PM


View Complete Forum Thread with Replies

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

Help W/ Code For Navigation
this is what i have, its not working exactly right:


on (release) {
gotoAndPlay(2);
if (totalFrames = loadedFrames) {
loadMovie("stevethee.swf", "process");
}
}

what im trying to do:
i have a main swf. with a nav. and a 'loading sequence'

when u hit a button on the nav. i want it to play the loading sequence (frames 2-75)
then load an external swf. that goes w/ that button.


-then if you hit another button the existing swf. will stay thre the loading sequence will play over it untill the new swf is loaded and replaces it.

anyone help?
thanks take care

-
similar to the principals of the nav. on
http://www.2advanced.com/archive/v2/flashindex.htm

Navigation Code?
Where can I can find the code for this navigation: http://www.3xpression.com/home.html

How do they make the box move? _x position, right? But, how?

Does anyone know where there is a lesson for this? I'm not finding anything.

Thanks ahead of time.

Navigation Code
I havent done flash in a while but im use to flash 4/5. And i can do everything in MX cept the actionscript set up is still wierd to me compared to flash 4/5.

But i made a site in flash with buttons and they are set to button format what is the code for flash MX to have the button go to the certain frame on the Timeline?

Cause i thought i had it right and it wont work

The frames name is Services, and its Frame #7

Please help, im so confused with flash mx lol... the actionscript set up looks good but looks like they changed it a little to much for me so far, im overwelmed!

How Do I Code This Navigation?
Im trying to code a similar navigation as the site below and I am having trouble even getting started. Can anyone point me in the right direction to some script similar to this site. I'm looking to create the smooth transitions and being up to move the navigation bar up and down. thanks.


http://toddevents.com/

Best Navigation With Code.
show the best navigation with code there

Easy Way To Code This Navigation?
Hi, I am very impressed by the simple and stylish site navigation used on www.imagedive.com I mean the navigation menu in the bottom left corner.

I want to have the same navigation on my site but havent a clue on how to accomplish this. Looked everywhere for a similar code example that I could learn from, but found nothing.

Any help would be appreciated. Thanks

Ideas On This Navigation Code
I was looking at this site and I'm presuming the navigation/site uss lots of actionscript. I'm just starting out. Can anyone break the components down into smaller bitsized bits for me ? Is it as complex as it looks ? Could you build it so it could be easily updated ?


Cheers

Super Navigation Code
super gallery code!!
hi friends, I really was looking for the script for this popular gallery navigation..
http://www.yestoall.com/curriculum.php

maybe someone knows where i can find it?
i remember i found it once, but not able anymore...
thanks in advance, guys!!

s

Simple Website Navigation Code?
Hello,

I was wondering if anyone could post up the simple navigation actionscript for creating a website - on release, go to....? ect.

Help appreciated

Thanx!

Buttons For Navigation - Code Check
i am just starting out making flash movies, and basically the way I have been making the navigation work is on every button, I assign the action to go to the movie clip where my "content" is and then I also have to tell it to gotoandStop in frame 1 of every other movie clip, which means they do not show up on the stage because all the frame ones are blank), so as you can imagine this gets exhausting when you have more than a few pages, and it is a pain to update. Can anyone offer a more streamlined, simplified way to accomplish this?

Here is an example of what I do now:

on (release) {
_root.contentemployment.gotoAndStop(1);
_root.contentprofile.gotoAndStop(2);
_root.contentnews.gotoAndStop(1);
_root.contentcontact.gotoAndStop(1);
_root.contentframe.contenthome.gotoAndStop(1);
_root.contentourwork.gotoAndStop(1);
_root.contentresidential.gotoAndStop(1);
_root.contentcommercial.gotoAndStop(1);
_root.contentcivic.gotoAndStop(1);
_root.contenturban.gotoAndStop(1);
_root.contentinstitutional.gotoAndStop(1);
_root.contentprofile.profilemarty.gotoAndStop(1);
_root.contentprofile.profilepete.gotoAndStop(1);
_root.contentprofile.profilebryan.gotoAndStop(1);
}

[FMX]i'm Stuck - Have A Problem With A Code For Navigation
hi,
i built this navigation bar where there is an arrow and menus - when u roll over a menu the arrow slides to it....
now what i'm trying to do is that when u press a menu and then u roll over another menu and when u roll out that menu it slides back to the pressed menu - like a magnet affect....
can anyone help me achieve this affect - all my attempts failed....
here is the fla. it's in FMX:

Buttons For Navigation - Code Check
i am just starting out making flash movies, and basically the way I have been making the navigation work is on every button, I assign the action to go to the movie clip where my "content" is and then I also have to tell it to gotoandStop in frame 1 of every other movie clip, which means they do not show up on the stage because all the frame ones are blank), so as you can imagine this gets exhausting when you have more than a few pages, and it is a pain to update. Can anyone offer a more streamlined, simplified way to accomplish this?

Here is an example of what I do now:

on (release) {
_root.contentemployment.gotoAndStop(1);
_root.contentprofile.gotoAndStop(2);
_root.contentnews.gotoAndStop(1);
_root.contentcontact.gotoAndStop(1);
_root.contentframe.contenthome.gotoAndStop(1);
_root.contentourwork.gotoAndStop(1);
_root.contentresidential.gotoAndStop(1);
_root.contentcommercial.gotoAndStop(1);
_root.contentcivic.gotoAndStop(1);
_root.contenturban.gotoAndStop(1);
_root.contentinstitutional.gotoAndStop(1);
_root.contentprofile.profilemarty.gotoAndStop(1);
_root.contentprofile.profilepete.gotoAndStop(1);
_root.contentprofile.profilebryan.gotoAndStop(1);
}

[FMX]i'm Stuck - Have A Problem With A Code For Navigation
hi,
i built this navigation bar where there is an arrow and menus - when u roll over a menu the arrow slides to it....
now what i'm trying to do is that when u press a menu and then u roll over another menu and when u roll out that menu it slides back to the pressed menu - like a magnet affect....
can anyone help me achieve this affect - all my attempts failed....
here is the fla. it's in FMX:

[source Code] Roll Over Navigation
Last edited by M40 : 2007-11-29 at 06:05.
























- Online Demo
- Source Files

This is a class I wrote for a projects. I was asked to share it and here it is. The class is named RollOverNavigation. You need 2 Movie Clips and 2 lines of code to use it.
- Movie Clip 1 - the one to be moved by the mouse, and
- Movie Clip 2 - the one to determine which area of Movie Clip 1 should be visible.

Here are the 2 lines of code you need to use the class:


ActionScript Code:
var myObject = new RollOverNavigation(image_mc, mask_mc);
myObject.turnOn();

This example uses Movie Clips that are in the library and have instances on the Stage. If you want to use the class with dynamicly loaded clips (loaded with actionscript), you have use it after the clips are loaded.

That's it! I hope you find the code useful. Suggestions and comments are very welcome

CuePoint Navigation Vs. CueSegment Navigation
Having problems throwing up a talking head slide show in MX2004 Pro.

1) The slider works going forwards, but not going backwards
2) The buttons seeking slides work going forward, but not going backwards

After talking with tech support, it seems the problem is with how they set up CuePoint navigation. Basically, a single time point = cue point triggers an event, which is a slide change. This is triggered from left to right in time, but not going the other way.

A slide show requires a different action script; however. It is not cue points that are linked with slides, but SEGMENTS in time are linked with STATES that correspond with a certain slide being in place.

Is there an action script expert out there who could help me program this into a slider that really works, going backwards and forwards?

If that is too ambitious, how can I subtract 300 milliseconds from q.time?

This will at least, hopefully, make the slide buttons work, since they will seek to a time point slightly before the actual cue point.

Jonas

CuePoint Navigation Vs. CueSegment Navigation
Having problems throwing up a talking head slide show in MX2004 Pro.

1) The slider works going forwards, but not going backwards
2) The buttons seeking slides work going forward, but not going backwards

After talking with tech support, it seems the problem is with how they set up CuePoint navigation. Basically, a single time point = cue point triggers an event, which is a slide change. This is triggered from left to right in time, but not going the other way.

A slide show requires a different action script; however. It is not cue points that are linked with slides, but SEGMENTS in time are linked with STATES that correspond with a certain slide being in place.

Is there an action script expert out there who could help me program this into a slider that really works, going backwards and forwards?

If that is too ambitious, how can I subtract 300 milliseconds from q.time?

This will at least, hopefully, make the slide buttons work, since they will seek to a time point slightly before the actual cue point.

Jonas

[F8] Loading And Unloading External SWF Code Issues, Code Check Please
Okay, I'm still clumsy with AS and I'm having problems loading and unloading external SWFs. I have SWFs created by others in Captivate that need to be controlled by a main menu. I created the menu and buttons and have been trying to code it so that with the button click, the appropriate external SWF loads in an empty movie clip, plays, and then closes at the final frame and returns to the menu. So far, I can get it to load, but then I'm stuck as I'm not sure what I'm missing as far as it reading the frame numbers.

Here's the code I've written. I can't seem to get my idea for the onEnterFrame function checking the frames to work.

What am I missing? Can anyone offer any suggestions or guidance? Thanks!


Code:
this.createEmptyMovieClip("clip1", 1);

myfirst_btn.onRelease = function() {
clip1.loadMovie("externalswf1.swf");
}

mysecond_btn.onRelease = function() {
clip1.loadMovie("externalswf2.swf");
}

mythird_btn.onRelease = function() {
clip1.loadMovie("externalswf3.swf");
}

clip1.onEnterFrame = function() {
if (clip1._currentframe == clip1._totalframes) {
// remove move clip1 and return to menu
clip1.removeMovieClip();
}
}

External SWFs, Code Works But Not With Additional Code
I'm using a loadMovie code that works perfect by itself, but when I add additional code to the button, it doesn't work.

Here's the scenario:

I have an MC named songs In this MC I have several buttons that should each perform very similar actions.

The first action is a:

gotoAndPlay("somewhere"); action that takes the movie to a specific frame of this MC. This code by itself works fine.

The second action I need to happen is:

this.contents.loadMovie("music1.swf") which loads an external SWF which is nothing more than an MC with an audio clip. This code, by itself works fine.

The problem comes when I combine the two codes to create:

on (release)
{
gotoAndPlay("somewhere");
this.contents.loadMovie("music1.swf");
}

The movie does go to the "somewhere" frame, but the external SWF no longer loads.

I have tried it with _root.songs.contents.loadMovie("music1.swf");

I have tried placing the loadMovie code first, but neither of those solutions work.

Any ideas?

Thanks

Help> How To Remove Part Of The Code Without Breaking The Entire Code
I use the following code on my website (http://www.misenplace.com.br ), it`s a fading out script that shows a banner underneath it.

I want to remove the pagetitle, welcome, date and sitename, but I can`t figure it out since when I remove something the movie doesn`t load or it doesn`t fade out as it was supposed to.

here`s the code


Quote:




var imgLoader = new MovieClipLoader();
var mindepth = welcome_txt.getDepth();
mindepth = mindepth < pagetitle_txt.getDepth() ? (mindepth) : (pagetitle_txt.getDepth());
mindepth = mindepth < date_txt.getDepth() ? (mindepth) : (date_txt.getDepth());
mindepth = mindepth < sitename_txt.getDepth() ? (mindepth) : (sitename_txt.getDepth());
var maxdepth = welcome_txt.getDepth();
maxdepth = maxdepth > pagetitle_txt.getDepth() ? (maxdepth) : (pagetitle_txt.getDepth());
maxdepth = maxdepth > date_txt.getDepth() ? (maxdepth) : (date_txt.getDepth());
maxdepth = maxdepth > sitename_txt.getDepth() ? (maxdepth) : (sitename_txt.getDepth());
this.createEmptyMovieClip("imageHolder_mc", mindepth - 1);
imageHolder_mc._x = 0;
imageHolder_mc._y = 0;
imageHolder_mc._alpha = 0;
imageHolder_mc.duplicateMovieClip("imageMasker_mc" , maxdepth + 1);
imageMasker_mc._alpha = 0;
imgLoader.loadClip(imageName, imageHolder_mc);
imgLoader.loadClip(imageName, imageMasker_mc);
welcome_txt.text = themessage;
welcome_txt._visible = false;
welcome_txt.autoSize = true;
var sitename_str = pagetitle;
var pagetitle_str = "";
var pos = sitename_str.indexOf(" - ");
if (pos > 0)
{
pagetitle_str = sitename_str.substr(pos + 3);
sitename_str = sitename_str.substr(0, pos);
} // end if
pagetitle_txt.text = pagetitle_str;
pagetitle_txt._visible = false;
pagetitle_txt.autoSize = true;
sitename_txt.text = sitename_str;
sitename_txt._visible = false;
sitename_txt.autoSize = true;
var curdate = new Date();
var date_str = curdate.toString();
var pos = date_str.indexOf(":");
var datestr = date_str.substr(0, pos - 3);
datestr = datestr + (", " + date_str.substr(date_str.length - 4));
date_txt.text = datestr;
date_txt._visible = false;
date_txt.autoSize = true;
imgLoader.onLoadComplete = function (targetMC)
{
_root.onEnterFrame = function ()
{
if (imageHolder_mc._alpha < 100)
{
imageHolder_mc._alpha = imageHolder_mc._alpha + 3;
}
else
{
if (!welcome_txt._visible)
{
welcome_txt._visible = true;
pagetitle_txt._visible = true;
sitename_txt._visible = true;
date_txt._visible = true;
imageMasker_mc._alpha = 100;
} // end if
imageMasker_mc._alpha = imageMasker_mc._alpha - 3;
if (imageMasker_mc._alpha <= 0)
{
delete _root["onEnterFrame"];
} // end if
} // end if
};
};






thanks a lot everyone

Movieclip Code Interacting With Document Class Code
I'm coding an application in Flash CS3 but relying heavily on doing most of the heavy lifting in actionscript3. I've set a document class (i.e. package me.mine{ class Main extends Sprite(){} }) with most of the code necessary.

In my Library I've got a Movie Clip for a control panel. I instantiate the movie clip from the Main class. This movie clip will change itself around (an off state and an on state with different menu options) - and i want to be able to add a button within the clip, and when it's clicked, have it call out to a function in the the Main class.

But I can't figure out how to get the MovieClip to talk to the Main class (I can set event listeners from the Main class on elements in the clip, but the clip will change around so I want it to work in the other direction).

Thanks for your help!

How Do I Execute Code Then Move To Another Frame When Code Is Finished And Run More?
hello. im well new to flash and im tring to build a cool flash movie using MC Tween in action script. my problem is i want to execute soem code then whenits finisd move on to frame 5 which has more code in it and then execute that code and so on how do i achieve this.
thanks

Code - What Code? You Didn't Spend Hours Writing It.
Hello,

Has anyone had a problem where sometimes (for no apparent reason) flash doesn't retain your code after you save and quit and then reopen the fla?

I used to think this was happening due to my backup app., but it's not running anymore. I even saved an additional copy of the file on my desktop AND dragged another copy to another folder. Everything was missing the same code.

We I published the swf before exiting, it worked perfectly.

Any ideas for fixes? Running os 10.3. Tried getting rid of prefs - no luck.

This is getting annoying. Happens with every fla I'm editing.

Thanks,
Ward

Newbie Convert Button Code To Frame Code
Hi all!

I guess this is a really simple one.

I have a button with the following code attached to it:


PHP Code:



this.onRelease = function() {    SWFAddress.setValue('/portfolio/');}this.onRollOver = function() {    SWFAddress.setStatus('/portfolio/');}this.onRollOut = function() {    SWFAddress.resetStatus();} 




I want to use this code on a frame. Is it onLoad I need to use??

Object/embed Code Missing From Source Code
I have the wackiest problem.. its killing me. I developed a simple flash banner for a client. It works fine on 99% of all machines, but the client's machine happens to be in the 1% that it DOES NOT work on. When he pulls up the page containing the flash file, he gets nothing. He has the latest flash plugin, and can view other flash content. When I view the source code on the machine that is having the problem, all the code is there EXCEPT the object/embed code. Its just missing. What in the world could cause that? I checked for firewall issues. He is running norton firewall. I disabled it, but he still has the problem.

This is the page in question:
http://projects.newtarget.net/RELOconnections/flashtest.html

as you can see, nothing special. simple flash, simple code. the other computers in his office have no trouble, its just his computer and his parents computers. I tried the page in IE 6 and firefox. Same result, he is not getting the flash code. He's on WinXP.

Can anybody think of ANY reason why he would be being shielded from getting object/embed flash code?

-vb

My Code Has No Friends: The Story Of My Sucky Code
I have an text input. I want it so that when you hit enter, it'll do stuff.

I want one of the commands to be...

goto

...however, here's the issue:



onClipEvent (enterFrame) {
pressed = Key.getCode();
pinputinn = pinput.toLowerCase();
if ((pinputinn == "goto") and (pressed == 13)) {
gotoAndStop (2);
}
}


Could someone tell me why that doesn't work, and what would work?
[Edited by Crickett on 07-20-2001 at 11:17 PM]

No Flash And No Embed Code In Source Code?
I really dont know whats going on here, when i try to embed my flash into a html or php document the flash movie does not appear when browsing, when i view source the code is not even there but all other code changes are reflected (i know the document has been updated). When i go direct to the swf url I can see the file. when i publish the swf with html it works fine locally but again online i cant even see the code. other flash files work fine on my site, this is a problem on IE and firefox.. whats going on???????

[F8] Help. Integrate Cpu Check Code With Preloader Code
Hi, guys!

I was looking for a way to do a cpu check over the user´s computer and then, based on the user´s cpu speed, redirect his browser towards one of two different versions of the same flash movie (let´s say, a "light" one without effects and a "full" one with all the effects). I´ve already got a fine working preloader, and I´ve found a nice cpu check code here in this forum. The problem now is that I am not able to put them together. Something like, after a mouseclick, perform the cpu check and after that load a movie based on the previous cpu check...

I am posting my fla and the original cpu check fla that I´ve found here to show what I´ve got so far.

Thanks in advance!

[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??}

I Need Some Basic Help Getting My Pseudo Code Into Working Code
id appreciate a hand from you guys, if you could.

ive got a fla (575x431) that im making for an image gallery.... i will have 20 images that will be icons probably 40-50% smaller than the full size image these will be movie clips that i will assign a very slow random movement to
i think that i have the random part ok, i just need some help with this part...

pardon me if my terminology isnt right..

If mouse (over) a mc, then;
stop mc, show mc label, title.

If mc is clicked, then;
enlarge scale of mc (ie, 100%) and center it on the stage.

If mouse (out) then;
return mc size to its former state and continue moving randomly.


hope this makes sense would really appreciate some direction....

thanks alot

løk

Javascript Code To Actionscript Code?
I have some actionscript code that makes a really cool clock effect. I was wondering if anyone knew how to convert the javascript code to actionscript or if it is even possible to do. If not, does anyone know how to recreate the effect in flash/actionscript? You can view the actual javascript effect by going to www.uncontrol.com and clicking on the clock file. The javascript code is as follows:

Thanks for any help...

-- K



__________________________________________________ ______



// clock
// created using proce55ing application | www.proce55ing.net
// copyright© www.uncontrol.com | mannytan@uncontrol.com

// ************************************************** **********************
// initialize
// ************************************************** **********************
boolean mouseStatus = false;
boolean priorMouseStatus = false;
int x, y, z;
int i, j, k;
float counter=1;
String time,s_hour,s_min, s_sec;
float pos_x, pos_y;
float radius;
float SECOND_INC = .0166;// 1/60
float MINUTE_INC = .0166;// 1/60
float HOUR_INC = .0833;// 1/12
float current_sec, current_min, current_hr;
float radian_percentage;
// ************************************************** **********************
// set up
// ************************************************** **********************
void setup() {
size(400, 400);
background(255);
hint(SMOOTH_IMAGES);

BFont ocr;
ocr = loadFont("OCR-B.vlw.gz");
setFont(ocr, 16);
ellipseMode(CENTER_DIAMETER);
rectMode(CENTER_DIAMETER);
}

// ************************************************** **********************
// listeners
// ************************************************** **********************
void mousePressed() {
mouseStatus = true;
}
void mouseReleased() {
mouseStatus = false;
}

void loop() {
translate(width/2, height/2);
radian_percentage = ((mouseY+.0001)*.0025);
rotateX(TWO_PI * radian_percentage * -1);

// --------------------------------------------
// analog marks numbers
// --------------------------------------------
push();
rotateX(TWO_PI*(.25));
for (i=1;i<=12;i++) {
push();
if (i==12) {
noStroke();
fill(255,102,0);
} else {
noStroke();
fill(0,0,0,75);
}
rotateZ(TWO_PI*((i)*HOUR_INC));
if (i<10) {/* ads a zero*/
text("0"+i, -5, -145);
} else {
text(""+i, -5, -145);
}
//rect(0,145,4,10);
pop();
}
pop();

// --------------------------------------------
// digital marks colon symbols
// --------------------------------------------
push();
translate(cos(2*TWO_PI*radian_percentage)*7+7,0);
rotateX(TWO_PI*(radian_percentage));
text(":", 0, 0);
pop();
push();
translate(cos(2*TWO_PI*radian_percentage)*-7+2,0);
rotateX(TWO_PI*(radian_percentage));
text(":", 0, 0);
pop();
push();

// --------------------------------------------
// second
// --------------------------------------------
current_sec = second();
radius = 120;
translate(cos(2*TWO_PI*radian_percentage)*10+10,0) ;
rotateY(TWO_PI*(((45)+current_sec)*SECOND_INC)*-1);

// draw shaded circle
noStroke();

// draw numbers
for (i=0; i<=59;i++) {
push();
translate(radius,0);
rotateZ(TWO_PI*(((30-i)+current_sec)*SECOND_INC)*-1);
translate(radius,0);

rotateZ(TWO_PI*(((30-i)+current_sec)*SECOND_INC));
rotateY(TWO_PI*(((45)+current_sec)*SECOND_INC));
rotateX(TWO_PI*(radian_percentage));

if (i==current_sec) {/* highlights current time*/
fill(255,102,0);
} else {
fill(0,0,0,50);
}
if (i<10) {/* ads a zero*/
text("0"+i, 0, 0);
} else {
text(""+i, 0, 0);
}
pop();
}

pop();

// --------------------------------------------
// minute
// --------------------------------------------
current_min = minute() + (second()*SECOND_INC);
radius = 100;
push();
translate(0,0);
rotateY(TWO_PI*(((45)+current_min)*MINUTE_INC)*-1);

// draw shaded circle
noStroke();

// draw numbers
for (i=0; i<=59;i++) {
push();
translate(radius,0);
rotateZ(TWO_PI*(((30-i)+int(current_min))*MINUTE_INC)*-1);
translate(radius,0);

rotateZ(TWO_PI*(((30-i)+int(current_min))*MINUTE_INC));
rotateY(TWO_PI*(((45)+current_min)*MINUTE_INC));
rotateX(TWO_PI*(radian_percentage));

if (i==int(current_min)) {/* highlights current time*/
fill(255,102,0);
} else {
fill(0,0,0,50);
}

if (i<10) {/* ads a zero*/
text("0"+i, 0, 0);
} else {
text(""+i, 0, 0);
}
pop();
}
pop();

// --------------------------------------------
// hour
// --------------------------------------------
current_hr = hour()%12 + (minute()*MINUTE_INC);
radius = 40;
push();
translate(cos(2*TWO_PI*radian_percentage)*-10-10,0);
rotateY(TWO_PI*(((9)+current_hr)*HOUR_INC)*-1);

// draw shaded circle
noStroke();

// draw numbers
for (i=0; i<=11;i++) {
push();
translate(radius,0);
rotateZ(TWO_PI*(((6-i)+int(current_hr))*HOUR_INC)*-1);
translate(radius,0);

rotateZ(TWO_PI*(((6-i)+int(current_hr))*HOUR_INC));
rotateY(TWO_PI*(((9)+current_hr)*HOUR_INC));
rotateX(TWO_PI*(radian_percentage));

if (i==int(current_hr)) {/* highlights current time*/
fill(255,102,0);
} else {
fill(0,0,0,50);
}

if (i==0) {/* ads a zero*/
text("12", 0, 0);
} else if (i<10) {
text("0"+i, 0, 0);
} else {
text(""+i, 0, 0);
}
pop();
}
pop();
// ************************************************** **********************
// mouse press initializer
// ************************************************** **********************
if (mouseStatus == true && priorMouseStatus == false) {
priorMouseStatus = true;

// ************************************************** **********************
// mouse press looper
// ************************************************** **********************
} else if (mouseStatus == true && priorMouseStatus == true) {
priorMouseStatus = true;

// ************************************************** **********************
// mouse release initializer
// ************************************************** **********************
} else if (mouseStatus == false && priorMouseStatus == true) {
priorMouseStatus = false;

// ************************************************** **********************
// mouse release looper
// ************************************************** **********************
} else if (mouseStatus == false && priorMouseStatus == false) {
priorMouseStatus = false;
}




}

Adding Code To Existing Code
I've been after an answer for this problem for some time!

I have a 2-layerd movie which consists of a roll-over script. When the cursor goes over my movie it loads the 2nd layer. Very simple!

I would like a passage of text to appear also, in a seperate area of the frame, when the cursor rolls over the same movie.

How would this be possible? Can I add some coding to the existing code thats placed on the movie?

PLEASE PLEASE HELP IF YOU CAN!

Adding Code To Existing Code
I've been after an answer for this problem for some time!

I have a 2-layerd movie which consists of a roll-over script. When the cursor goes over my movie it loads the 2nd layer. Very simple!

I would like a passage of text to appear also, in a seperate area of the frame, when the cursor rolls over the same movie.

How would this be possible? Can I add some coding to the existing code thats placed on the movie?

PLEASE PLEASE HELP IF YOU CAN!

Adding Code To Existing Code
I've been after an answer for this problem for some time!

I have a 2-layerd movie which consists of a roll-over script. When the cursor goes over my movie it loads the 2nd layer. Very simple!

I would like a passage of text to appear also, in a seperate area of the frame, when the cursor rolls over the same movie.

How would this be possible? Can I add some coding to the existing code thats placed on the movie?

PLEASE PLEASE HELP IF YOU CAN!

[AS3] Run Code End Of Movie W/o Timeline Code?
Super noob question on AS3. I'm told that I'm to avoid putting any code in the timeline and use classes instead. I have a simple logo running in the beginning it has no timeline code. How do I make it so that it will call a function when the movieclip is finished playing?

Thanks!

How To Convert Java Code To As3 Code
package ConvertNumberIntoWords;

class EnglishDecimalFormat {
private static final String[] majorNames = {
"",
" thousand",
" million",
" billion",
" trillion",
" quadrillion",
" quintillion"
};

private static final String[] tensNames = {
"",
" ten",
" twenty",
" thirty",
" fourty",
" fifty",
" sixty",
" seventy",
" eighty",
" ninety"
};

private static final String[] numNames = {
"",
" one",
" two",
" three",
" four",
" five",
" six",
" seven",
" eight",
" nine",
" ten",
" eleven",
" twelve",
" thirteen",
" fourteen",
" fifteen",
" sixteen",
" seventeen",
" eighteen",
" nineteen"
};

private String convertLessThanOneThousand(int number) {
String soFar;

if (number % 100 < 20){
soFar = numNames[number % 100];
number /= 100;
}
else {
soFar = numNames[number % 10];
number /= 10;

soFar = tensNames[number % 10] + soFar;
number /= 10;
}
if (number == 0) return soFar;
return numNames[number] + " hundred" + soFar;
}

public String convert(int number) {
/* special case */
if (number == 0) { return "zero"; }

String prefix = "";

if (number < 0) {
number = -number;
prefix = "negative";
}

String soFar = "";
int place = 0;

do {
int n = number % 1000;
if (n != 0){
String s = convertLessThanOneThousand(n);
soFar = s + majorNames[place] + soFar;
}
place++;
number /= 1000;
} while (number > 0);

return (prefix + soFar).trim();
}

public static void main(String[] args) {
EnglishDecimalFormat f = new EnglishDecimalFormat();
System.out.println("*** " + f.convert(0));
System.out.println("*** " + f.convert(17708));
System.out.println("*** " + f.convert(16));
System.out.println("*** " + f.convert(100));
System.out.println("*** " + f.convert(118));
System.out.println("*** " + f.convert(200));
System.out.println("*** " + f.convert(219));
System.out.println("*** " + f.convert(800));
System.out.println("*** " + f.convert(801));
System.out.println("*** " + f.convert(1316));
System.out.println("*** " + f.convert(1000000));
System.out.println("*** " + f.convert(2000000));
System.out.println("*** " + f.convert(3000200));
System.out.println("*** " + f.convert(700000));
System.out.println("*** " + f.convert(5960809));
System.out.println("*** " + f.convert(123456789));
System.out.println("*** " + f.convert(-45));
System.out.println("*** " + f.convert(99565789));
// (99565789)


/*
*** zero
*** seventeen thousand seven hundred eight
*** sixteen
*** one hundred
*** one hundred eighteen
*** two hundred
*** two hundred nineteen
*** eight hundred
*** eight hundred one
*** one thousand three hundred sixteen
*** one million
*** two million
*** three million two hundred
*** seven hundred thousand
*** five million nine hundred sixty thousand eight hundred nine
*** one hundred twenty three million four hundred fifty six thousand seven hundred eighty nine
*** negative fourty five
*** ninety nine million five hundred sixty five thousand seven hundred eighty nine

*/
}
}

Where Should I Place The Preloader Code In This Code..
hi Users,

I am working on a Flash Project in which I have to display a Calendar highlights the dates which have events. Now before loading the Calendar I am calling all the info from a PHP file and then storing it in an array and the using the info for highlighting the days of the events. Now as the info is getting big and big the Calendar is taking sometime to load. I want to place a preloader so that it shows that the Calendar is getting the info. The problem is that I dunno where to place the preloader code. Here is my code where I am getting the info from PHP files:


ActionScript Code:
tellTarget (_root) {
    cal.stop();
    eventDates = new LoadVars();
    eventDates.load("getEvents.php");
        eventDates.onData = function(values) {
        if (values == undefined) {
            eventDates.load("getEvents.php");
        } else {
            checkPlay();
            _root.eventsCollection = new Array();
            _root.eventsCollection = values.split("~");
        }
    };
    //
    recursiveEvents = new LoadVars();
    recursiveEvents.load("getEvents1.php");
    recursiveEvents.onData = function(values) {
        if (values == undefined) {
            recursiveEvents.load("getEvents1.php");
        } else {
            checkPlay();
            _root.recEventsCollection = new Array();
            _root.recEventsCollection = values.split("~");
        }
    };
}
i = 0;
function checkPlay() {
    i++;
    if (i == 2) {
        play();
    }
}

Now I would like to know where should I put the preloader code. Need help. The above code is in a MovieClip which is placed on the main stage.

Regards,
Xeeschan

Help Please With Code Animated Rollover Code
I am trying to make a tutorial i got from http://www.were-here.com/content/tem...d=679&zoneid=7 work and i have done everything but the code didn't work. I have rewrote it and it also doesn't work. Could someone please take a look at it or tell me where I can go to get a better tutorial that does the same thing.

on (rollOver)
if (_currentframe=1)
gotoAndPlay(2);
else if (_currentframe=20)
stop
else
gotoAndPlay (39-_currentframe)
end if}
end on

on (rollOut)
if (_currentframe=20)
gotoAndPlay (21)
else
gotoAndPlay (39-_currentframe)
end if
end on

Code To Long Any Other Way To Write This Code
i've been reading / learning actionscript 3 and i am making some simple practice .. but its too long any other way i can write this code it works fine but its too long.. thanks


Code:
package
{
import flash.display.Sprite;
import flash.text.*;
import flash.net.*;
import flash.events.Event;
import flash.display.StageScaleMode;
import flash.display.StageAlign;

public class Test extends Sprite
{
//private
private var navStyle:StyleSheet;

//NAV CONTAINER
private var navContainer:Sprite;

//HOME
private var home:Sprite;
private var homeText:TextField;

//COMPANY
private var company:Sprite;
private var companyText:TextField;

//SERVICES
private var services:Sprite;
private var servicesText:TextField;

//CONTACT
private var contact:Sprite;
private var contactText:TextField;

public function Test() {
init();
}
public function init():void {
loadStyleSheet();
initStage();
}
private function loadStyleSheet():void
{
var styleLoader:URLLoader = new URLLoader();
styleLoader.addEventListener(Event.COMPLETE , completeListener);
styleLoader.load(new URLRequest("css/test.css"));
}
private function completeListener (e:Event):void {
var navStyle:StyleSheet = new StyleSheet();
navStyle.parseCSS(e.target.data);

navContainer = new Sprite();

// HOME
home = new Sprite();
homeText = new TextField();

homeText.selectable = false;
homeText.antiAliasType = AntiAliasType.ADVANCED;
homeText.autoSize = TextFieldAutoSize.LEFT;
homeText.styleSheet = navStyle;
homeText.htmlText="<p class='navigation'><b>HOME</b></p>";
home.addChild(homeText);
addChild(home);

// COMPANY
company = new Sprite();
companyText = new TextField();

companyText.selectable = false;
companyText.antiAliasType = AntiAliasType.ADVANCED;
companyText.autoSize = TextFieldAutoSize.LEFT;
companyText.styleSheet = navStyle;
companyText.htmlText="<p class='navigation'><b>COMPANY</b></p>";
company.addChild(companyText);
addChild(company);

// SERVICES
services = new Sprite();
servicesText = new TextField();

servicesText.selectable = false;
servicesText.antiAliasType = AntiAliasType.ADVANCED;
servicesText.autoSize = TextFieldAutoSize.LEFT;
servicesText.styleSheet = navStyle;
servicesText.htmlText="<p class='navigation'><b>SERVICES</b></p>";
services.addChild(servicesText);
addChild(services);

// CONTACT
contact = new Sprite();
contactText = new TextField();

contactText.selectable = false;
contactText.antiAliasType = AntiAliasType.ADVANCED;
contactText.autoSize = TextFieldAutoSize.LEFT;
contactText.styleSheet = navStyle;
contactText.htmlText="<p class='navigation'><b>CONTACT</b></p>";
contact.addChild(contactText);
addChild(contact);

home.x = 0;
company.x = home.width + 20;
services.x = company.x + company.width + 20;
contact.x = services.x + services.width + 20;
navContainer.addChild(home);
navContainer.addChild(company);
navContainer.addChild(services);
navContainer.addChild(contact);
addChild(navContainer);

}

private function textFormat (navText:TextField, menuLabel:String):void {
navText = new TextField();
navText.selectable = false;
navText.embedFonts = true;
navText.antiAliasType =AntiAliasType.ADVANCED;
navText.type = TextFieldType.DYNAMIC;
navText.autoSize = TextFieldAutoSize.LEFT;
navText.styleSheet = navStyle;
navText.htmlText ="<p class='navigation'><b> "+menuLabel+" </b></p>";
}
private function initStage():void {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
}

}
}

Help Me With This Code(small Code) Mx
I need help with this script.

I dont find the way to make it display the correct month.
I know that flash does count from 0 to 11 for the months but i cant find out how to make it display 10 for october.

calendarday = today.getDate() + "/"+ today.getMonth() + "/" + today.getFullYear();

Btw is someone knows how to make the real day names and months show up instaed of the numbers it would be nice if you give me a hand on it

Thanks a lot

Code W/in Code Problem
hello, all, have an AS question:

i have a movie clip that, upon rollover, plays the movie clip. upon rollout, the movie clip plays in reverse. now, the last frame in this movie clip has two additional movie clips, so if you can envision:

test
|
|
|
-----> test_02
|
|
-----> test_03

both test_02 and _03 have animation, such that, upon rollover, the movie clip plays and upon rollout, the movie clip plays in reverse. the code for all three are, in fact, the same.

i have tested the code, and all of them work just fine. however, when i place test_02 and test_03 in the test movie clip, their animation (rollover, rollout) does not work.


here is the code on the movie clip (it is the same code for test, test_02, and test_03, but the variable names are just different)

on(rollOver){
_root.over_test = true;
}
on(rollOut){
_root.over_test = false;
}

here is the code on the actions layer:

n_test.onEnterFrame = function(){
if(_root.over_test){
this.nextFrame();
}else{
this.prevFrame();
}
}

any help is greatly appreciated.

Capturing Key Code. Which Code Is Better
Hi!
I want to check whethe user has pressed the TAB key or not.I can write the code in two ways.I want to know which one is better?
1)on Movieclip
onClipEvent (keyDown) {
kp = Key.getCode();
if (kp == 9) {
trace("tab is pressed");
}
}

2)on Button
on(keyPress "<Tab>"){
trace("tab is pressed");
}

Which method is better. Is there any advantages/drawbacks of using above code?
Thank You.

Mahesh K.

Do I Need To Use Less Code Or Can I Delete This Code?
I am using the code below on each MC (16 in all) so that each MC will appear in the swf at 90% of original size. These will be used for thumbnails for larger pics in the site.

My 2 part question is this - (1) is there a different way to do the same effect that uses less code? (2) if I uses the code the way it is, is there a way to delete the code once the thumbnails have all appeared on the stage?

code:

onClipEvent( EnterFrame ){
var speed = 10
var viscosity = 1.3
xscale = 75
yscale =75
difference = xscale - this._xscale
xvelocity = (xvelocity + difference / speed) / viscosity
this._xscale = this._xscale + xvelocity
difference = yscale - this._yscale
xvelocity = (xvelocity + difference / speed) / viscosity
this._yscale = this._yscale + xvelocity
}

Can Anyone Tanslate AS2 Code Into AS3 Code? Willing To Pay For Help
Hi, I am having a world of errors and trouble trying to translate some code from as2 to as3. Its pretty complex. can anyone help? Willing to pay you something.

Convert AS1 Code To AS3 Code
Hi All;
I have a lot of code in AS1 and which I have to vonvert to AS3.There are 4000 files so it is difficult to write all the code from scratch.

So, can anybody suggest me the esiest way to convert these code from AS1 to AS3.

Please Help Me..............
Thanks in Advance.........

Can AS1 Code Call AS3 Code?
I was wondering if there was any way for AS1 code to call AS3 code.

I need to write a server extension for SmartFox Pro. I just found out that the only version of action script that SmartFox sever extensions can be written in is AS1. However, I have a bunch of code already written in AS3 that I need to use. I have all of the source for the AS3 code.

Is there a way for me to use my existing code, or am I out of luck?

Thanks in advance
John Lawrie

AS3 - Regexp For [code] ... [/code]
Hi all!

How would one write an regexp that detects the occurances of [c0de] ... [/c0de] in a textstring? for example:

Lorem ipsum [c0de]dolor sit amet, consectetur adipiscing elit.[/c0de] Curabitur pulvinar nisl eget turpis. Aenean nulla. Integer bibendum sapien sit amet lorem. Integer vulputate enim ut diam. Fusce non sapien. Vivamus venenatis. [c0de]Nulla facilisi.[/c0de] Mauris tincidunt turpis at lorem. Nulla tellus. Suspendisse vitae nisl ac diam consectetur tempus.

Navigation Help Please...
Hi everyone...
I'm currently building a website-like presentation and what I need to do goes like that:
I have three text blocks (not dynamic) that are the menus in which the user navigates.
I want to put like a box (which is a MC) around those text whenever the user has the mouse over the texts...
With actionscript I'd like to make this box float around, stopping over each option in the menu. Up till now I have three invisible buttons and whenever I rollover those buttons the box's _x property takes it to each text block, having no movement whatsoever. I could do that the "dirty way" by making several animations and framelabels with a whole bunch of goTo's but I'd like to learn the ActionScript way.
If you read this and it's still confusing, just reply and I'll answer your questions...
Thank you very much
Cheers

Navigation
I have a flash navigational bar at the buttom of a html page split into frames.
But don't know how to set up the navi bar so that it goes to the previous and next pages in the document. When the prevoius or next are clicked it is displayed in the other frame.

Cheers!

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