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








Quick Code Question...


Hi all,
can anyone tell me how I make the following code gotoAndPlay - a scene?

ie: what replaces "home"



on(release){
_level0.section="Contact";
tellTarget("_level0") {
gotoAndPlay("home");
}
}

Thanks
Skribble.




FlashKit > Flash Help > Flash ActionScript
Posted on: 08-08-2002, 05:20 AM


View Complete Forum Thread with Replies

Sponsored Links:

Quick Code Help
i++;
// i = i+1 or i+=1
duplicateMovieClip ("txt0", "txt" + i, i);
//duplicate the movieclip txt0 cand call its text plus i which is increasing
set ("txt" + i + ":txta", substring(text, i, 1));
// No idea
setProperty ("txt" + i, _x, getProperty("txt" + (i-1), _x)+10);
// not 100 percent sure about that get property crap.

View Replies !    View Related
Quick Php Code Please
I know this should be like 3-5 lines at the most.

I would like the php code that will add an email to a text file that contains...emails.

in my flash file I ask for people's emails and want to add them to the already existing list with php.

Could someone send me a quick fix? I know it's simple, but I am missing some brain cells right now.

Thanks!

View Replies !    View Related
Some Quick Code Help.
Ok. So I'm writing this code for a menu, and then I go to check it, and it says there needs to be a '(' and a ')' on lines 5 and 6. I have abousloutly no idea where these need to go. Could you help me?


Code:
onClipEvent(enterFrame) {
if.xpos=50
root.arror.gotoAndPlay(2)
}

View Replies !    View Related
[F8] Quick Help With Code
I have this attached file

www.thinking-tank.com/files/preloader.fla

I am trying to make this preloader mc named "loader" to work with the MCL action. Can some one shed some light into how I can make this work ?

Thanks

View Replies !    View Related
[F8] Need Quick Fix For Code Error
Hi. I have a movieclip button which when pressed directs the playhead to another frame. This is the code I use:


PHP Code:



_root.submit.onRelease = function() {
    if (answer == "silence") {
            gotoAndPlay("correct");
            result += 1;
            questionNum++;
    } else {
        gotoAndPlay("incorrect");
        questionNum++;
    }
}




However, I also need to add a keypress action.
This is the code I used:


PHP Code:



_root.submit.on(release, keyPress "<Enter>") = function() {
    if (answer == "silence") {
            gotoAndPlay("correct");
            result += 1;
            questionNum++;
    } else {
        gotoAndPlay("incorrect");
        questionNum++;
    }
}




IT DOESN'T WORK!
Returns a 'expected field name after (.).

How would I write this simple bit of code?

Cheers folks!

View Replies !    View Related
Quick Code Re-write (as2-as3)
Let me preface my post by saying that I am not an AS writer. I find it much easier to come here and get the stuff I need from all of you AS geniuses. I have this little piece of script that I need to re-write in AS 3. I'm using the FlashEff plugin on a banner ad, but need it re-write the get URL portion of the button in AS3 in order for it to work. Here's that code:

on (release) {
getURL(_root.clickTAG, "_blank");
}

Can someone show me the AS3 version of this? Thanks!!!

View Replies !    View Related
Quick Tidy Up Of Code
Does anyone know of a way to tidy up this code? seems to be an awful lot of repeated code here but i have no clue as to how i can simplyfy it all???

var bottom_level_nav_loc:String = "bottom_pages/";

bottom_menu.buttons.homepage.addEventListener(Mous eEvent.CLICK, mainClick_homepage);
bottom_menu.buttons.about_us.addEventListener(Mous eEvent.CLICK, mainClick_about_us);
bottom_menu.buttons.dealer_enquiries.addEventListe ner(MouseEvent.CLICK, mainClick_dealer_enquiries);
bottom_menu.buttons.gallery.addEventListener(Mouse Event.CLICK, mainClick_gallery);
bottom_menu.buttons.help_n_support.addEventListene r(MouseEvent.CLICK, mainClick_help_n_support);

//GENERALL MOUSE SETTINGS
var c:Color=new Color();

bottom_menu.buttons.homepage.addEventListener(Mous eEvent.MOUSE_OVER, mouse_over_homepage);
bottom_menu.buttons.about_us.addEventListener(Mous eEvent.MOUSE_OVER, mouse_over_about_us);
bottom_menu.buttons.dealer_enquiries.addEventListe ner(MouseEvent.MOUSE_OVER, mouse_over_dealer_enquiries);
bottom_menu.buttons.gallery.addEventListener(Mouse Event.MOUSE_OVER, mouse_over_gallery);
bottom_menu.buttons.help_n_support.addEventListene r(MouseEvent.MOUSE_OVER, mouse_over_help_n_support);
//MOUSE OVER SETTINGS
var over_settings_1:uint = 0xff0000;
var over_settings_2:Number = .8;


bottom_menu.buttons.homepage.addEventListener(Mous eEvent.MOUSE_OUT, mouse_out_homepage);
bottom_menu.buttons.about_us.addEventListener(Mous eEvent.MOUSE_OUT, mouse_out_about_us);
bottom_menu.buttons.dealer_enquiries.addEventListe ner(MouseEvent.MOUSE_OUT, mouse_out_dealer_enquiries);
bottom_menu.buttons.gallery.addEventListener(Mouse Event.MOUSE_OUT, mouse_out_gallery);
bottom_menu.buttons.help_n_support.addEventListene r(MouseEvent.MOUSE_OUT, mouse_out_help_n_support);
//MOUSE OUT SETTINGS
var out_settings_1:uint = 0xcccccc;
var out_settings_2:Number = 0;


bottom_menu.buttons.homepage.buttonMode = true;
bottom_menu.buttons.homepage.useHandCursor = true;
bottom_menu.buttons.about_us.buttonMode = true;
bottom_menu.buttons.about_us.useHandCursor = true;
bottom_menu.buttons.dealer_enquiries.buttonMode = true;
bottom_menu.buttons.dealer_enquiries.useHandCursor = true;
bottom_menu.buttons.gallery.buttonMode = true;
bottom_menu.buttons.gallery.useHandCursor = true;
bottom_menu.buttons.help_n_support.buttonMode = true;
bottom_menu.buttons.help_n_support.useHandCursor = true;


// MAIN CLICK FUNCTIONS
function mainClick_homepage(e:Event):void {
i.load(new URLRequest("index.swf"));
container.content_container.addChild(i);
menu_mc.sub_nav.gotoAndStop(0);
}
function mainClick_about_us(e:Event):void {
i.load(new URLRequest(bottom_level_nav_loc+"about_us.swf"));
container.content_container.addChild(i);
menu_mc.sub_nav.gotoAndStop(0);
}
function mainClick_dealer_enquiries(e:Event):void {
i.load(new URLRequest(bottom_level_nav_loc+"dealer_enquiries. swf"));
container.content_container.addChild(i);
menu_mc.sub_nav.gotoAndStop(0);
}
function mainClick_gallery(e:Event):void {
i.load(new URLRequest(bottom_level_nav_loc+"gallery.swf"));
container.content_container.addChild(i);
menu_mc.sub_nav.gotoAndStop(0);
}
function mainClick_help_n_support(e:Event):void {
i.load(new URLRequest(bottom_level_nav_loc+"help_n_support.sw f"));
container.content_container.addChild(i);
menu_mc.sub_nav.gotoAndStop(0);
}

//MOUSE OVER FUNCTIONS
function mouse_over_homepage(e:Event):void {
c.setTint(over_settings_1, over_settings_2);
bottom_menu.buttons.homepage.transform.colorTransf orm=c; //mc is a MovieClip
}
function mouse_over_about_us(e:Event):void {
c.setTint(over_settings_1, over_settings_2);
bottom_menu.buttons.about_us.transform.colorTransf orm=c; //mc is a MovieClip
}
function mouse_over_dealer_enquiries(e:Event):void {
c.setTint(over_settings_1, over_settings_2);
bottom_menu.buttons.dealer_enquiries.transform.col orTransform=c; //mc is a MovieClip
}
function mouse_over_gallery(e:Event):void {
c.setTint(over_settings_1, over_settings_2);
bottom_menu.buttons.gallery.transform.colorTransfo rm=c; //mc is a MovieClip
}
function mouse_over_help_n_support(e:Event):void {
c.setTint(over_settings_1, over_settings_2);
bottom_menu.buttons.help_n_support.transform.color Transform=c; //mc is a MovieClip
}

//MOUSE OUT FUNCTIONS
function mouse_out_homepage(e:Event):void {
c.setTint(out_settings_1, out_settings_2);
bottom_menu.buttons.homepage.transform.colorTransf orm=c; //mc is a MovieClip
}
function mouse_out_about_us(e:Event):void {
c.setTint(out_settings_1, out_settings_2);
bottom_menu.buttons.about_us.transform.colorTransf orm=c; //mc is a MovieClip
}
function mouse_out_dealer_enquiries(e:Event):void {
c.setTint(out_settings_1, out_settings_2);
bottom_menu.buttons.dealer_enquiries.transform.col orTransform=c; //mc is a MovieClip
}
function mouse_out_gallery(e:Event):void {
c.setTint(out_settings_1, out_settings_2);
bottom_menu.buttons.gallery.transform.colorTransfo rm=c; //mc is a MovieClip
}
function mouse_out_help_n_support(e:Event):void {
c.setTint(out_settings_1, out_settings_2);
bottom_menu.buttons.help_n_support.transform.color Transform=c; //mc is a MovieClip
}

View Replies !    View Related
Quick Code Snippet Help.
Not even high doses of caffeine have helped me figure this one out. I am almost bald with hair pulling now. =)

Should be easy, tried everything. I want to populate the outside variable login_auth.

Here's the code:

login_auth ='';

login.submit_btn.onRelease = function(){
if (login.user_login.text != "" && login.pass_login.text != "") {
//status = "Begin Login Process - Wait...";
lognVars = new LoadVars();
lognVars.u = login.user_login.text
lognVars.p = login.pass_login.text
lognVars.sC = coupon.md5()
lognVars.sendAndLoad(php_file, lognVars, 'POST');
lognVars.onLoad = function(){
login_auth = this.uu;
}
}
track_display_mc.display_txt.text = login_auth;
login._visible = false;
enableButtons();
}

no matter how I try with using _root or _parent or _parent._parent or _level0 or just like it is, the variable login_auth outside the function never gets populated/changed when the submit button is clicked the first time. To make this even more frustrating I can see it changing locally in the lognVars.onLoad function correctly, and if I then click the submit button again a second time it populates the outside login_auth variable just fine. The code above only works every other one... always on the second click of the button. Help! thank You!

View Replies !    View Related
Quick Cfc Code Check Please.
ActionScript Code:
import mx.remoting.*
import mx.rpc.*


var myresponder:RelayResponder = new RelayResponder(this,"getCombobox_con_Result","getCombobox_con_Fault");
var getCombobox_con:Service = new Service("http://localhost/flashservices/gateway",null,"getData_uf",null,myresponder);
var pc:PendingCall = getCombobox_con.getComboxitems();

function getCombobox_con_Result(result){
  // display successful result
 
  trace(getCombobox_con.results.getLength())
}
function getCombobox_con_Fault(fault){
  trace("error")
}


is there something I am missing to get the result back as a recordset obj? I am getting undefined.
in my cfc I have the returntype="query" do I have to change that?

when using the remoting connector component its fine but I rather do it manually.

is relay responder the quickest way to have a function called when the results get back?


thanks.

View Replies !    View Related
Quick Code Conversion Help, Please
The problem is that this code was written (obviously) to be on a button, but I'm now using a keyListener instead and for the life of me, I can't get this code to convert away from the on(release) aspect to regular code.

Could someone please fix this for me so that the code works with:

KeyListener = new Object();
KeyListener.onKeyDown = function() {
if (Key.getAscii() == 13) {
checkMe();
}
};
Key.addListener(KeyListener);







Attach Code

onClipEvent (load) {
playOrder = new Array(1,2,3,4,5,6,7,8,9,10).sort(shuffle);
position = 0;
function shuffle():Number {
return Math.floor(Math.random() * 3) - 1;
}
}

on (release) {
_root.gotoAndStop(playOrder[position]);
this.gotoAndPlay(playOrder[position++]);
_root.txtAnswer.text = " "
if (position >= playOrder.length) {
_root.gotoAndStop(11);
playOrder.sort(shuffle);
position = 0;
}
}

View Replies !    View Related
Quick Code Question
I know this is VERY basic and easy, so forgive me, but I just need to know how to change this code. What I tried didn't work.

I'm using a tutorial to make a menu, and in the tutorial it assumes that you're starting with a new .fla, but instead I made a movie clip for the menu within an .fla I was already working on, for a header.

The code I was supposed to use was this one, for the invisible button:


Code:
on (rollOver) {
_root.mouse_over_company_mc= true;
}
on (rollOut) {
_root.mouse_over_company_mc= fstartlse;
}

on (release){
getURL(”http://www.mysite.com/”);
}
and for the main action script, this:

Code:
_root.company_mc.onEnterFrame = function() {
if (mouse_over_company_mc) {
_root.company_mc.nextFrame();
} else {
_root.company_mc.prevFrame();
}
};
So what I did was everytime I saw "_root", I changed it to "menu_mc." but it didn't work.

Also, even though I put a stop action on my menu movie clip, the animation keeps going and doesn't stop.

Sorry again for the n00biest question....

thanks!

View Replies !    View Related
Quick Question About This Timer Code
does anyone know if this timer code eats up a lot of CPU? and is there any easier way to go about this?


Code:
_global.timeReset=function(){
start = getTimer();
limit=1;

};

_global.cTimer = function(){
elapsed=Math.round((getTimer()-start)/1000)
_root.timeRemain=left=limit-elapsed
_root.timeleft = left;
if(left<=0){
counter = 0;

}

};

setInterval(cTimer, 25);

View Replies !    View Related
Quick Question. Confused About This Code.
I am trying to figure out one of Senocular's fla's.
http://www.interactive.toolblast.com...&ucat=2&kind=2

This is a small segment of code that is confusing me. The only thing you need to know is that that "next" is a variable.

buttonHandling = function () { if (next == this._parent.movie) {return;}if (next) {if (next._currentframe != 11) {return;}......

What does "if (next)" mean? I am used to seeing statements like "if (next == mcCow" or whatever. But ive never seen "if (variable)". If someon could clarify that for me then i'll be able to figure out the rest of the .fla. THANKS!

View Replies !    View Related
Quick Code For Storing Variables
I need a quick script that can allow me to store data in an external file (such as a .txt file) then load it up the next time I run the movie. These events both happen after a button press.
Any help is appreciated.

View Replies !    View Related
Real Quick Code For Popup
I created a flash site which opens a new browser box using:

on (release) {
getURL ("JavaScriptop();");
}

As the action.


In the HTML page i have.....
function pop() {
window.open("http://www.thewoj.com/main.html","","height=550,width=790,left=0,top=0") ;
}

It all works fine, HOWEVER.... I don't know the code to use to CLOSE this popup box with a flash button.

Anyone know??

-Steve

View Replies !    View Related
Quick Q: On Draw Circ Code
so this prototype draws circles:

PHP Code:



MovieClip.prototype.dc=function(x,y,r){
    var a=r*0.414213562;
    var b=r*0.707106781;
    this.moveTo(x+r,y);
    this.curveTo(x+r,y-a,x+b,y-b);
    this.curveTo(x+a,y-r,x,y-r);
    this.curveTo(x-a,y-r,x-b,y-b);
    this.curveTo(x-r,y-a,x-r,y);
    this.curveTo(x-r,y+a,x-b,y+b);
    this.curveTo(x-a,y+r,x,y+r);
    this.curveTo(x+a,y+r,x+b,y+b);
    this.curveTo(x+r,y+a,x+r,y);





im curious to why those two #'s 0.414213562 & 0.707106781 ???

thnx !!~~

View Replies !    View Related
Check My Preloader Code Please? (very Quick)
Hi folks.

Need help before I can post my files, not feeling very confident I've done this right, but it seems to work just fine so...

Would somebody check my code please and make sure there isn't something catastrophically bad in it:

1st frame of main timeline:


this.onEnterFrame = function() {
filesize = content.getBytesTotal();
loaded = content.getBytesLoaded();
preloaderMC._visible = true;
if (loaded != filesize) {
preloaderMC.loadBar._xscale = 100*loaded/filesize;
} else {
preloaderMC._visible = false;
content._visible = true;
}
}

That's it, that's all I have. I don't remove the onEnterFrame if I'm loading say 100 jpgs, right?

Thanks so much!

-Beanpie

View Replies !    View Related
Frame Rate Quick Code
WoW... i've writen code so much harder... this seems so simple but i cant figure out the logic or commands to do it.
Q. How would i make a movieclip with a text box inside called FrameRate show the frame rate.
To make it easy im just going to put the code on the movieclip itself.
Thanks Guys in advanced.

View Replies !    View Related
AS3 Quick Code Snippet Needed
I've been looking but since I don't really know my end result, it's hard to search correctly.

I basically need


Code:
onRelease {
this.gotoAndPlay (2)
}
converted to AS 3. I mildly understand classes / functions but just don't know enough AS3 yet. Any help is appreciated.

This is my current code.


Code:
this.menuBox_mc.contact_btn.addEventListener(MouseEvent.MOUSE_DOWN,rotateImage);

-----

function rotateImage (e:MouseEvent) {
_root.images.gotoAndPlay(2);
}

View Replies !    View Related
Check My Preloader Code Please? (very Quick)
Hi folks.

Need help before I can post my files, not feeling very confident I've done this right, but it seems to work just fine so...

Would somebody check my code please and make sure there isn't something catastrophically bad in it:

1st frame of main timeline:


this.onEnterFrame = function() {
filesize = content.getBytesTotal();
loaded = content.getBytesLoaded();
preloaderMC._visible = true;
if (loaded != filesize) {
preloaderMC.loadBar._xscale = 100*loaded/filesize;
} else {
preloaderMC._visible = false;
content._visible = true;
}
}

That's it, that's all I have. I don't remove the onEnterFrame if I'm loading say 100 jpgs, right?

Thanks so much!

-Beanpie

View Replies !    View Related
Frame Rate Quick Code
WoW... i've writen code so much harder... this seems so simple but i cant figure out the logic or commands to do it.
Q. How would i make a movieclip with a text box inside called FrameRate show the frame rate.
To make it easy im just going to put the code on the movieclip itself.
Thanks Guys in advanced.

View Replies !    View Related
Quick Question For Cleaner Code
Just need some advice on how to clean this code up. I know there has got to be a way to combine the 2 movieclips....

Basically I have 4 movieClip buttons. currently only the first is working.... How would I add the other f2, f3, f4 MC's without having to write a function for each one?

Here is the code I have:

Code:

f1.addEventListener(MouseEvent.MOUSE_OVER, hoverOver);
f1.addEventListener(MouseEvent.MOUSE_OUT, hoverOut);

f2.addEventListener(MouseEvent.MOUSE_OVER, hoverOver);
f2.addEventListener(MouseEvent.MOUSE_OUT, hoverOut);

f3.addEventListener(MouseEvent.MOUSE_OVER, hoverOver);
f3.addEventListener(MouseEvent.MOUSE_OUT, hoverOut);

f4.addEventListener(MouseEvent.MOUSE_OVER, hoverOver);
f4.addEventListener(MouseEvent.MOUSE_OUT, hoverOut);

function hoverOver(event:MouseEvent):void
{
   f1.gotoAndPlay(2);
}

function hoverOut(event:MouseEvent):void
{
   f1.gotoAndStop(11);
}

f1.buttonMode = true;
f2.buttonMode = true;
f3.buttonMode = true;
f4.buttonMode = true;

View Replies !    View Related
Quick Question Regarding Sound Effects Code.....
I have a pretty quick question, hopefully gonna be an easy one to answer.

I have a function created to play background sounds, this basically implements the "attachSound", sound.start(); code however, when i want to play specific sound effects i would like to pause this background loop so that the sound effect can be heard clearly without interference.

To do this i have set up a basic variable which is set to "true" when the sound.start(); code is used, this defines that the sound loop IS playing.

Then when I want to stop the sound loop and play a sound effect i know i can use a simple "if" statement which stops the loop if the value is "true" and then play a sound effect.

BUT my problem is: how can i get it to recognise when the sound effect has finished playing, so that the background loop starts up automatically? I hope i have explained myself well enough

View Replies !    View Related
Quick Email Form Code Question
I went to actionscript.org and checked out the code for a contact form in flash. This template already had a contact form there, but no code in it.

I took the code I found from actionscript.org, and used it in the template, but I think I might be missing something small here.

Could someone help me by looking at the file?

Thanks in advance!

http://www.lastdaydesigns.com/PODD2/main.zip

View Replies !    View Related
[CS3] Customizing The Code Quick Finish Menu
I've noticed that when you install third party components, some add their API to the actionscript quick complete menu. How can I do that for my own classes?

View Replies !    View Related
AS3 Writing Concise Code - Quick Question
mc1.alpha=.5;
mc2.alpha=.5;
mc3.alpha=.5;
etc.

Can be shortened to:

mc1.alpha=mc2.alpha=mc3.alpha=.5;

Can this be shortened even more? I would ideally like to write my property only once.

View Replies !    View Related
Quick Code To Set The Movies Volume To 0 (AKA Turn Sound Off)?
Hey guys, this is the code I have to turn off the sound in my game:


Code:
_root.setVolume(0);
Yet it doesn't work. I know I'm doing something wrong, but I'm just not sure what. Thanks for the help.

View Replies !    View Related
[MX04] A Not So Quick Favor - Looking For Somone To Edit My Code
Hey gang,

I know you all are busy people and this post may not go anywhere beyond this point, but I was wondering if there was a brave soul out there with a bit of time on his or her hands that would be so kind as to take a look at my code for a website I'm building and see if there are any places where I can tighten it up. I'm having a bit of performance issues and I'd like to make sure my code is as clean as possible to ensure a smoother site. Currently the code is 1134 lines long, and the .swf is 204k, which isn't terrible, but could stand to be looked at.

Rather than post the code here, I thought I'd just put the request out there. If you are feeling kind enough to take a look, please PM me and I'll send it along.

The code all works, BTW... it's just a little dirty.

Anyway, if nothing more comes of this post, that's totally cool. I know I'm asking a lot and am greatful to any person who wants to take a stab at it.

Thanks in advance!

-Sandy

View Replies !    View Related
HElp QUick PLEase Load In Html Code To Be Displayed In Htmlbox
HEY!
i have a dead line due very soon on a project and a part i though would be veary easy isent...

im opening this page to import variables:
http://www.valj.nu/live/script/show.php
that variable is being read in by


ActionScript Code:
kc = new LoadVars();kc.load("http://www.valj.nu/live/script/show.php");if (kc.loaded==true){        trace("done");        kc.onLoad = function() {        trace(this.hej);        info_txt.text=this.hej;    };};

done traces, and then inbetween it traces blank spaces...
info_txt.text
is a dynamic textbox with the html button pressed.
why is nothing showing?

thanks
//VoS

View Replies !    View Related
Quick Code Fix For Externally Loaded Flash File
hi there, i know that someone out there can easily take a look at my problem and know immediately what i did wrong. but that's not me!

i have a test website here which has externally loaded files coming into the container on the main index page. the code on the buttons at the top right hand corner have this code on each of them for the externally loaded .swf files to come in:

on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "contact";
container.loadMovie("contact.swf");
} else if (_root.currMovie != "contact") {
if (container._currentframe>= container.midframe) {
_root.currMovie = "contact";
container.play();
}
}
}

and that all works perfectly fine. what my problem is is when i click on the "contact" button and i'm on that page. on the left hand side column towards the bottom, i have a block of text with one red word. i want that word to bring in the f.a.q. page (and replace the contact page i'm currently looking at) which can also be accessed from the top nav. just a little thing, but i wanted to learn how to do it.

i've put the same code into the invisible button that says "faq" which is identical to the code listed above except i changed all instances of "_root" to "_parent" but that didn't do it. i think it's something like that that would have to do with the problem. any help is appreciated!

thanks,
denise

View Replies !    View Related
[quick N Dirty Code Snippet] Text Ticker
Here you go.... a text ticker, often asked for - pretty basic but very easy code:


ActionScript Code:
createTextField("content3_txt",this.getNextHighestDepth(),0,0,Stage.width,200);
content1="-- You bet on Black? ----- It came up Red? ----- For an affordable debt solution visit Grabbit & Run Associates......";
tcount = 0;
content2 = " ";
tlength = 50;
secs = 0.05;
for(i=0;i<=tlength;i++){
content1+=" ";
}
init(2);
//
function init(num){
myTInt = setInterval(scrollT, secs*1000);
loops=num
}
function scrollT() {
    content2 = content1.substring(tcount-tlength, tcount+1);
    content3_txt.text = content2;
    tcount++;
    if(tcount==content1.length){
        if(loops==1){
        clearInterval(myTInt)
        trace("finished");
        }else{
            tcount=0
            loops-=1;
        }
    }
}


Questions? None? Good.....

View Replies !    View Related
Quick Question - Need Quick Answer - Load Movie
If I load an swf movie into one mc named "mc1". and then I want to load the same swf movie into another mc "mc2", will the swf need to load again into mc2 or will it already be catched.

I am assuming yes ...

Thanks,
DRB
[Edited by funner on 06-14-2001 at 09:53 PM]

View Replies !    View Related
Best Way To Script A Quick-slow-quick Movement ?
Hi

I'd like to make a clip move across the stage like this :

- first it moves fast and then decelerates to a slow crawl for a short while then re-accelerates and moves fast to the end of its movement

what's the best way to do this ?

is it better to use mx transitions or intervals or another system ?

thanks

View Replies !    View Related
Quick Quick....masking Problelm
Hi everyone
Um facing a problem regarding masking
well, i know how to mask texts with objects that I CREATE like a circle, for example the masked layer has text & the mask layer has a circle that I DRAW USING FLASH...this if fine...it works well
My problem is my masking does not work when i the mask layer has an object that is imported, for example an imported heart instead of a drawn circle....it does not work at all....!!!!
What's the problem?? & How could i solve it??
Any help is highly appreciated
thanks in advance

View Replies !    View Related
Quick Question = Quick Answer
I have a movie with an animation on one layer. Just a motion tween over 5 frames. In this movie I also want to target a blank clip and have another .swf load into that clip.

I'm putting the loadmovie script on a blank frame in my actions layer (frame 1) telling the .swf to load into the blank clip.

nothings happening? any fixes?

View Replies !    View Related
Project Opp - Quick $ Quick Job
I have a project that requires a rotating menu. It needs to be done today. If anyone is interested they should reply with their email address or send an email to eerkel @ hotmail .com.

I will then send a Fireworks file that shows clearly how the menu should operate.

Thanks

View Replies !    View Related
I Need Your Quick Assistance, Just A Quick "check, See, Tell"
Hello! Could you please go to this address

http://www.geocities.com/friendlyflashfun/clock.html

And tell me if my clock shows up?? I have FlashMX 7 Pro and it doesn't show up on my computer.

If it does or doesn't show up on yours could you please tell me how to correct this problem?

Thanks in advance,

Kelly

View Replies !    View Related
[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();
}
}

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

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

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

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

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

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

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

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

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

View Replies !    View Related
[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??}

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

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




}

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