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




Probably The Simplest Question Ever Asked About Functions...



Hi Everyone,

Sorry if this is the kind of question that I should already know the answer to because it's so ridiculously easy, but the truth is I cannot find anything about it anywhere on the net (though probably because it's rather obvious)

How do I call a function which has already been defined inside another one?


Code:
function example1 ():void {
mc1.gotoAndStop(10);
}
function example2 ():void {
<call function example1 here>
play();
}
Obviously that function isn't anything other than just to demonstrate what I'm on about.

Any help would be hugely appreciated!

Thanks



FlashKit > Flash Help > Actionscript 3.0
Posted on: 12-18-2007, 11:53 PM


View Complete Forum Thread with Replies

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

Possibly The Simplest Question Ever Asked Here...
hey everyone
i know this is the newbiest question ever but how can i make sure that my flash web site fits the width of any size screen. is it even possible?? i always seem to have a thin slice of background showing along the right side of the screen.
thanks in advance

saru110

The Simplest Preloader Ever?
I want to stop the movie wait on the first frame until the frame labled 'four' is loaded. I don't need percentages etc.


ifFrameLoaded ("four") {
play ();
}


this is the code I've come up with which isn't working what should I be using. Surely this is a simple one?

ta,

Len

Simplest Preloader Ever
implementing a bit of code for a preloader i picked up elsewhere here on the boards, i can't seem to get the dynamic text box to reflect the % loaded. the old method worked fine in F5, but i'm beating my head against the wall in MX.

here's the code:

Code:
MovieSize = _root.getBytesTotal();
LoadedSize = _root.getBytesLoaded();
PercentLoaded = LoadedSize / MovieSize
Percent = Math.floor(PercentLoaded*100);

_root.GrowBar._xscale = Percent

if (PercentLoaded < 1) {
gotoAndPlay("preload");
}
else {
gotoAndStop("movieStart");
}
i've created a small dynamic textbox on another layer with an instance name of 'Percent'. seems simple enough, but it still won't work!

help!

please download the fla and take a look:

http://www.advpres.com/cgreeneltch/MXpreloader.fla

thanks!

The Simplest Preloader Possible
i'm trying to make a preloader for those with slower connections, but cant seem to get the scripting right. wot is the simplist script to place in the loader scene so that wen the main page is loaded, it then moves to that page.

cheers

Simplest Preloader Possible
i'm trying to make a preloader for those with slower connections, but cant seem to get the scripting right. wot is the simplist script to place in the loader scene so that wen the main page is loaded, it then moves to that page.

cheers

Sometimes The Simplest Things...
This is very simple but I must be doing something basically wrong...

I have a 3 frame MC (test)

frame 1 stop
frame 2 play
frame 3 previous ()

What I want is to put an action on a blank keyframe that tells the timeline to stop when it gets to this MC and and go to frame 2 of the MC and play.
It then is supposed to just loop over frames 2 and 3 until I tell it to stop by going back to frame 1 later on on the main timeline. . It is supposed to make the projetor graphic look like it is running
Simple

I have this action on the keyframe in the main timeline.

stop()
tellTarget (_root.test) {
gotoAndPlay(2);
}

For some reason it doesn't go to frame 2 it just stits on frame 1 like a flounder. I've included a 2 frame .fla of just this part simplified.

Do I need to use clipevent instead or is the action on the wrong frame.? Thanks,,,I'm stumpped. This shoud work with Tell Target I would think.

Simplest Form
Hi,

I want to create a SIMPLE form in flash. I haev two text boxes for 'name' and 'email address'. On submit I want these to be emailed, If I can get a new page (form.php) to open with these variables then I can do it (form.php?name=personsname&emailaddress=personsema iladdress). Can someone tell me how to get this done, and if there is an easier way without using a new window/html frames??

Thanks.

The Simplest Question Ever
hi, i just started learning action script 3.0

i use the adobe flash cs3 professinal enviroment.

and when i write the simplest program like this:

package
{ <--------- error in this line
import....

public class...
{
...
}
}

when i press "test movie" or "test scene"
i get an error saying "1037: package cannot be nested"


all help would be appreciated =)

The Simplest Question
How Do U Embed A Font In A Component That Is Behind A Mask. For Exacmple,,, A Radio Button Label; At The Moment I Cant See This Behind The Mask, But I Can See The Button Itself.

The SIMPLEST Thing
I'm a beginner with Actionscript, but am comfortable with programming in other languages. I am creating a simple interface in Flash 8, and need to include some actionscript that I can apply to a button that will load a movieclip onto the stage from my library into a certain position. I have three buttons, in fact, and I want a movie to load that displays information about that button. Surely putting a movieclip onto the stage is easy?

HELP.Simplest Way To Do RollOuts?
Was wondering if anyone could provide me with a link or anything to help me get an idea of how to do roll-outs, as opposed to roll-overs

The Simplest Cue Point...
Hi,
I have embeded a cue point in a video (flv) and I named it "MyNextVideo".
I would really appreciate if someone tells me or gives me a simple script that when the video gets
to that point, it loads (plays) another video.
I don't have a single idea on how to do this, because I haven't used flash for a while.

Thanks

The Simplest Action Script Can Get
i'm a real beginner with flash. i'm trying to create a movie clip that continues to play forever.
so in the last frame i did:
frame actions> basic actions> gotoandplay (1);

so it would go back to the begining and play it all over again. although its so very simple i just cant get it to work. help!

Simplest Variable HTML2Flash
Hi,
There are several links in my homepage that open a pop-up window with a flash in it. Im trying to tell this flash to do something different depending on wich link I pressed to call the new pop-up window in wich it is found.

I think I should send different variables from the different links to the flash clip. And then (I can do this) tell the clip to do this or that depending on the variable the flash clip recieved.

The URL is http://www.youthing.es (the real case, it sends no variable at the moment)

I am trying some like 'popup.html?section=arts' in the HTML code of the homepage and 'loadVariablesNum ("popup.html", 0);' in the flash clip. But it does not work.

My server supports ASP what may be useful.

Could you please help me?

Thanx,
hip

The Simplest Flash Question EVER?
how do you make a line that "grows" i need to make a box that "draws" itself from one point to the end point. i know its something simple but i have a massive brain fart. i thought of making the line already and then masking it so it looks like its growing. there has to be a beter way. its really an interface that im shooting for, you know how lines draw the site while it loads. any help would be great. thanks.

Simplest Scrolling Menu
Hey guys,

I know how to make a scrolling menu via the old tutorials on the site, but what's the simplest way to do a mouseover scrolling menu with acceleration and deceleration?

thanks

Simplest Question In The World
My god I am a dumbass :S

How do you achieve something like

New X position of Object = Old X position of Object + Value

I dont get how to do the Old and New part :S

Preloader Down To Its Simplest Form
im not looking for a fancy preloader status bar thing... i just want to know how to get it to load the whole thing before playing, maybe with a little animation...

Cant Get The Simplest Thing To Work . . .
I have been away from flash for about a year so I have some catchin up to do, but this is rediculous. . .

I just want to have a dynamic text box that loads a file (faq.txt) from the same folder the flash is in. I have been through the tutorials, to no avail, I don't know why this is not working and I know you guys are way to smart to be dealing eith this simple stuff, but i am at my wits end. . .

I have the text box set to "dynamic"
its instance is "faq"
its var is "faqtxt"
I have the following AS in the first frame of the movie (which has only one frame and is for testing this only )

loadVariablesNum("faq.txt", 0);

the contents of the text file are as follows(except for the quotes):
"faqtext=This text should now appear in the box. &"


nothing happens when i test the file in flash ??
wha gives ??

Thanks

Simplest Sliding Bar Menu
Hello all,

i am trying to create a simple sliding bar menu. i couldn't find an exact example of what i need, but here is something similar:

http://www.flashkit.com/movies/Inter...-250/index.php

but this one is too complicated, i think what i want is simpler:
i want to have a row of buttons that would slide slowly to the side at constant speed (no acceleration), and when i roll over a button the sliding would stop and on MouseOut it would continue, and onClick it would go to a different HTML page. this is not going to be inside a Flash site, but rather be a banner inside an HTML page.

so, is there a simple way to do this?

thanks,
-maria.

Probably The Simplest Question In The World
Hey guys, as you might've guessed I'm new at using Flash, however I believe I've got most of the basics down.

What I want to know is how people make movies in which the camera zooms in and out and occasionally pans to places off screen via a side-scrollingish technique. The side-scrolling part being the one I want to know about the most.

In short, I want to know about camera control.

Can anyone tell me how any of this works or direct me to a tutorial that can help me? As far as I know I haven't found any tutorials that have been useful on the subject yet.

Centre Zoom - Simplest Set Up
Hi
I searched and found a few similar posts, but not exactly what I need ....

It's an image gallery I'm making and I'm just doing a photoshop-style zoom/pan navigator. I'm using loadClip and MovieClipLoader to load jpegs into an empty movie (content_mc) placed on the stage at a position in the top left corner of a surrounding frame. So I have a single container mc positioned top left and a single jpeg loading. I made a zoom bar and I'm using it to change the x/y scales of content_mc. It's working fine except that it's scaling from the top left corner.

What's the simplest way to get this set up zooming from the centre rather than the top left?

thanks
mark
flash8

This Is Probually The Simplest Question Out There So Please Help
This is rather emabarrassing, but I'm brand spankin' new to flash and I can't get the paint bucket to work. I think I may be expecting too much from it so will SOMEONE please tell me how it works? I'm a tad annoyed I've been to a whole buncha tutorials and NONE of them I've found answer this super basic question. When you want to fill something does it all have to be made from one line? It's seeming that way cause I can't get it to work. I just finished tracing one of my drawings was this all for nothing and coloring is really a long and complicated oredeal. Someone PLEASE answer. Thank you.

[F8] SIMPLEST Messageboard/whiteboard
What I want to do is very simple. I want to make a text-whiteboard like the original facebook wall. One txt file, anyone can change anything on it by just highlighting text, editing it, and pressing "update"

Basically it would be a text field in Flash, that would post using PHP that would write to a txt file stored somewhere on the server. I just don't know how to connect those three. Anyone have an example of this?

Please help! Theennnnks!

The Simplest And Craziest Mistake
I have been trying endlessly to accomplish one simple thing...
To make different circles rotate on the spot- they always wobble and shift.
I've tried using the snap tool, changing the orientation, changing the objects from movie clips to symbols, holding shift while positioning the next frame, and nothing prevents the shift!
Someone please help..

Simplest Way To Embed Fonts In AS
Hi,

I'm trying to embed Japanese fonts, just some characters or the whole set either is OK, but I use the same font in many text fields with dynamic text.

How can I embed the font once and then refernce it using AS throughout?

Simplest Way To Add Time Delay
Hi, I have a fairly complicated Flash 8 movie, with a lot of onRollOver functions, my client has just asked me to add a 1 second time delay between the RollOver and the consquence - SetInterval seems wrong, there must be a fairly way to do this.. hopefully something like:

Code:
two_btn.onRollOver = function() {
btnsDefault();
two_btn.enabled = false;
closersActive();
// checks if any other buttons are active
if (services_mc._x != 45) {
new Tween(services_mc, "_x", Elastic.easeOut, 200, 45, 2, true);
}
// time delay to be added here before Tween occurs
SetInterval:1000;
new Tween(profile_mc, "_x", Elastic.easeOut, 45, 200, 2, true);
}
Many thanks in advance!

Toby

Simplest Things Don't Work
I've been making flash games for years now, that's why it's so annoying that after taking a small break the most basic thing won't work for me. Basically trying to affect an objects visibility based on a variable.

object instance name="mc"
location=everything is in root.


Quote:




on(press){
if (_root.a>2){
_root.mc._visible=false;
}else{
_root.mc._visible=true;
}
}




why oh why won't this work- the fla is here:
2.fla - 0.05MB

Worlds Simplest Form Question
hi guys,

i have spent the requisite 2 hours searching for an answer....and of course could'nt find one so please help.

i have four input text boxes (lets try NOT to call it a form)

name
address
city
state

now i DON'T want to mail them or send them anyplace.

i just want to check that they have been filled in and give either a "well done" or a "go back you fool"

so i assigned each box a variable
(name, address, city, state...easy eh)

then i put this on the "finished" button
(trying not to call it a submit button)

-----------------------------------------------------------
on (release) {
if (name="") {
gotoAndPlay("tryagainyoufool"); //yes there is a frame labelled this
}else gotoandplay ('whatacleverboy"); //yup it's called that too
------------------------------------------------------------
yes..yes the rest of the feilds are included as "else if" statements but just putting one here makes it simple.

so i start my movie, dont fill in any info and click on the finished button. (i should be told how stupid i am)

nada, nothing, zilch...it just sits there laughing at me.

apparently i am neither a clever boy or a complete fool, i just sit here wondering if it is worth going to work tomorrow or should i just sit and wait for flash to finish checking my "if" statement

lolololololol.

any help would be most graciously accepted.

gary

I Want To Load Txt From .txt File. What's The Simplest Script To Do It?
I want to load txt from .txt file. What's the simplest script to do it?

The text will have no function other then just being read.


I'm using this so that if I'm ever at a computer that does not have flash mx on it, I can still update the site by editing the .txt file and the text on the flash site will be updated.

-Line

SIMPLEST Way To Make Sound Fade Out?
I always use a sound file and simply input it and make it look hundreds of times.

I know that users find this annoying, and I am not good with actionscript.

please tell me how I can make the sound loop a couple of times and then fade out slowly. thanks!

Simplest Software To Create Slideshow
I am on a mac and I want to create a slideshow of a bunch of images.

I want the images to fade in/out. I have done this in Flash MX.

Is there software that will allow me to create a fading slideshow Simpler and Quicker?

Simplest Code For Connecting With AMFphp
can any one tell me the simplest code and method to send and load data of php files using AMFphp. ( i m new with AMFphp ) pls help me out

Need Simplest Contact Form Solution
I have searched the forum, but I am wondering is it possible to do it without PHP or ASP. Can I just use an existing mail script like htmlformail from Matt Wright's script archive?

http://www.scriptarchive.com/formmail.html

Simplest Way To Send Data From Flash
I need to know a simple way to send data from a flash file to a mysql database...very easy... just when the user accesses the site they fill out a few questions they need to go into a database... thanks in advance for the help

Simplest Timed Loop Script Ever Please..
in no actionscripter but does anyone have the simplest timed loop using if else and variables?

like, if i put in 2000 (for 2 seconds) as the time i want it to loop for, then once that times up
it breaks and goes to the next frame.

does this few lines of script/holy grail exist even?

Embedding Fonts In The Simplest Of Movies
Hi,

I am finding this hard.
My first hurdle I think I've overcome which was how to pass a variable into a flash movie.


Code:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
width="300" height="120">
<param name="movie" value="flashvars.swf">
<param name="wmode" value="transparent" />
<param name="flashvars" value="asptext=hello" />
<!--[if !IE]> <-->
<object data="flashvars.swf"
width="300" height="120" type="application/x-shockwave-flash">
<param name="movie" value="flashvars.swf">
<param name="wmode" value="transparent" />
<param name="flashvars" value="asptext=hello" />
<h1>Hi There</h1>
</object>
<!--> <![endif]-->
</object>
So that worked.
I've used
text_txt.text=asptext;

But the font is not what I want.
It displays some sans-serif default font.

So I am trying stuff like making the textbox into a movie clip (I named it holder).
And then adding a new layer and assing an action like:

var fmt = new TextFormat();
fmt.color = "0x000000";
fmt.font = "Tahoma";
holder.text_txt.text=asptext;
holder.text_txt.setTextFormat(fmt);

Previously the text was red and it turn black so that is OK.
But the script it not making the font become "Tahoma"

What is the trick then?

How can I embed at least the font into the textbox control
so that I don't even need formatting but it will appear nevertheless.

Please let me know.

The Simplest Way To Duplicate 10 Movieclips And Move Them Randomly?
So I want to duplicate 10 movieclips.
Move them randomly within a certain boundry (1000x1000).
Then stop them on a hittest.

I've downloaded many examples, but they all seem overly complicated.

Can anyone suggest an easy way of doing this?

SIMPLEST Way To Stop Sounds On Button Rollout
I need to know if anyone can tell me the SIMPLEST way to stop mouse over button sounds on rollout. I have tried to figure it out myself but obviously I'm a complete dummy and haven't been able to get my sound objects defined right or something. Any help would be appreciated. I've been using this tutorial and I just can't get it to work. http://www.aspirin99.com/tutorials/sound/

Problem With Simplest Of "preloader Scripts
Whats up guys, designer here with what I would think would be a simple actionscript question.

I have a movie that has some fancy image fade-ins as it begins. Nice to see the first time but after that it just gets in the way. I want to have a simple script so once the user has viewed the intro, it doesn't play again until they need to reload it.

I have it setup like this:

scene: preloader

scene: "Scene 1" with intro fade ins

scene: "Scene 2" duplicate scene but without picture fading.

Now I basically want a script in my already completed preloader that says:

If Scene 1, Frame 20 has been loaded (so they have viewed the fade ins) then skip ahead to scene 3, frame 1.

else, play scene 1, frame 1.

Is this doable?

gallion311

The Simplest Way To Make A Button Not Reset When Clicked
I've made a button that has an animation movieclip when mouse over, and when I click it (on mouse release) I want it to stop and show the "down" keyframe, not loop the movieclip once more.

Anyone?

[CS3] Simplest Way To Load Audio File And Have Seek Bar
Previously, I have always just put the audio in the timeline and tweened the seek bar from the beginning to end, which is very simple but so far has worked for my purposes. I haven't required it to be draggable or anything fancy, just to play audio and give a basic idea of where they are in the file (oh and play/pause buttons of course).

However I now find myself with an audio file that is 40 some minutes long, and exceeds the Flash max of 16,000 frames.

So what I need to know, is a very simple, lightweight way to load the MP3 file into Flash, and have a seek bar (consistent of two movie clips, just an eagle which serves as the marker, and a bar behind it) which moves according to how far they are in the audio file.

I have searched all over, but all the solutions I find are either far too complex for my purposes (not to mention beyond my own understanding), or else they do not contain the seek bar, which really is my biggest dilemma.

Would be a bonus if I could also make the seek bar draggable, so you drag it to the end and the audio goes to the end, etc.

Another added bonus would be if the seek bar could automatically adjust to the MP3 file if I changed it, but that's not necessary if it is difficult.

Any help you can provide, resources you can point me towards, etc, will be greatly appreciated.

Thanks in advance.

What Is The Simplest Way To Load Variable From Text File?
how do i load a text file and the red text below as variable?
how do i read the content of a text file and put into variable part (red text)

Here im thanks to u all in advance. Hope somebody help me again


swfArray = new Array("p1.swf", "p2.swf");
var current = 0;
function updateSwfFile () {

if (current+1 < swfArray.length) {
current++;
} else {
current = 0;
}
swfHolder.loadMovie (swfArray[current]);
}
this.onEnterFrame = function () {
if (swfHolder._currentframe == swfHolder._totalframes) {
updateSwfFile();
}
}
updateSwfFile();

Simplest Keyboard Listening Captures Only Some Keys, Not Others
I have the simplest code and when I run it, there is no trace for most of the keys. It traces the W, and the U, but none ofthe other letter on that row. It traces all numbers, but not the - and =. It does trace shift- and shift=, the space bar, but not the enter or the escape. What could be the problem?
Code:
import flash.display.MovieClip; import flash.events.KeyboardEvent; import flash.ui.Keyboard; public class Application extends MovieClip { // Constructor public function Application() { stage.addEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler); } private function stage_keyDownHandler(e:KeyboardEvent):void { trace(e); } }

OK , You Asked For It
I want to learn all about Flash. I enjoy challenges so I got up my nerve and joined. Where is a good place to start? Something easy at first, please! I really would appreciate any help. I have signed up for a web site, not a free one, and it sits waiting for me to do something. I love the Flash type Splash pages. I just think they are unique. I don't want to over do it on my first site but would like for those visiting to say, "Wow, she really cares enough to work hard!" Any ideas on the Spash page? I know there are conflicting views on those and whether they are a waste of time but I don't care. Thanks, guys.

Probably Been Asked, But...
I can't find a clear answer on it...

I have 2 mc's that I've placed on my stage, root.mc1 and root.mc2. After mc1 finishes playing I want mc2 to start. In AS2 this would be accomplished by placing the following code on the last frame of mc1's timeline:


Code:
_parent.mc2.play()

//or even

_root.mc2.play()


What's the proper way to do that in AS3? I know placing code in child mc's isn't proper oop programming, I'm using a hybrid approach...

Thanks for your help!

I Know This Has Been Asked Before...
...but i cannot get it to work using the examples found on the forum. all i want is to download a .zip from my .swf. okay, easy enough, but i want it to open a dialogue box to ask me where i want to save it. i used:

on (release){
getURL ("testimonials/sww_day1.zip", "_self");
}

which is what i found here and it just opens an IE window with the content inside. is there a way to have it bring up a dialogue so the user can choose where to save it?

im so sorry that i need to ask this redundant question again. i used to be a strong flash user but after a nasty job experience, i forgot it all on purpose. now im trying to get back and i forgot a lot. even a nudge in the right direction will help. thanks!

I Know That This Has Been Asked Before?
I am doing a site for a client, and he wants all the text to be editable or that he can edit.. There really is not going to me that much text. I just want to learn how to do this. I know it can be done.. Just don't have a clue how thanks guys!!!!!

This Has Probably Been Asked...
...and there is probably an FAQ at the top about it, but I'm in sort of a rush to get this done (I have until Friday, but have school during the day and work until night, today is my only day off).

For English, we have to make a parody of a song, book, movie, TV show, anything. I want to make fun of something like The Matrix or F&F (which I might add is the stupidest movie I've ever seen; too fake)...problem is, I've had Flash MX 2004 for about....2 days now. I want to do a Flash animation because no one else is doing one, it's original, more fun to mess with, etc....the tutorials aren't doing crap for me though because on all of them you have to modify something instead of create your own.

So I need help with creating an animation that is just 2-3 minutes long...I don't even know where to start. I've been using Photoshop and HTML the past 6-7 years, but never this. This program is basically reading Chinese for me, hehe.

So can someone help me make a video?
AIM: ViciousBetrayal2

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