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




Whats The Deal With Functions?



The script below can have the bringAnimal callback before the function declaration and after it. However the animal="dog" has to be declared before the callback.

is there anything else important I should know?


ActionScript Code:
animal = "dog";bringAnimal();function bringAnimal() {    //trace("section1[0] "+section1[0])    trace("animal "+animal);}



Ultrashock Forums > Flash > ActionScript
Posted on: 2005-04-22


View Complete Forum Thread with Replies

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

Whats The Deal?
Why is it that when PC users visit my site it runs nice and smooth, but if someone on a Mac visits my site it totally lags? is there some option box i forgot to check when publishing to make it run fine on both, what am i doing wrong becasue i work on a mac at my job and only my site lags, no other?

Can anyone help?

Whats The Deal With This...?
hello,

thanks to everyone whose helped me this far.

I'm trying to add, attributes in xml. Ive attached what I was working on. I am having a hard time. Some of you probs. this is probably easy for.. but for a new guy like me.. eeeeeh..

If some one is willing to take a look at my .fla, and .xml and see if you can either point me in the right direction or maybe even give me an example of what I need to do.

In my .xml playlist I'm trying to add the artist name, song, a link, and a comment as well as the album artwork. I've not been able to add any of those..

I also can't figure out how to divide the playlist into 15 songs on one side, and 15 songs on the other. almost like 2 playlists.

I searched tons of tutorials read threw them, and still nothing works.. I know im an idiot and just missing it...

mp3player.zip


please help

WHats The DIGIT Deal ?
Hi ppl,
can anyone tell me what the deal is with maximum number of digits in a number please ? i seem to be able to produce ( and i want to as well) many digit numbers after 0. , but things go screwy with many digits..( not that many really),,
whats the e+ thing as well ?
any help would be FAB !.
cheers again
Shane

Whats The Deal With Swish Max?
Im new to flash ,just wondering if someone could tell me a little more about swish max is it like the macromedia software.Can you make cool flash sites with it , and why is it so cheap compaired to macromedia software prices? Any info would be wonderful!!!!!!

So, Whats The Deal... (FLA Inside)
here y'all go. continuing my hunt for a solution to this problem, here's a FLA (www.chrishoare.ca/tester/menumovie.fla) of this SWF (www.chrishoare.ca/tester/menumovie.swf). Goto the SWF and you'll see my problem - the whole menu goes back up when you mouse over one of the buttons in the menu system because I suppose flash takes that as a "rollOut" call? Maybe? I dunno, it's got me at a loss as to how to get around this. And I'm so close...

Chris

Coolioman seemed to have heard of this happening before...

Whats The Deal With My Flash MX?
sup guys,

i been having a problem with my flash for quite a while now. At first it was no biggie, but now its beginning to bug me.

ok so heres the deal

Im working on a basic angular shape. I want to move one of the anchors. I choose the anchor select tool. I select the anchor. Then i want to move the anchor by using the left, right, up, down keys on my keyboard. When i do this, flash quits on me. This sux badly. Sometimes i do massive work and then its all lost because of this glitch . And the thing is, this doesnt always happen. It just seems to happen everytime i dont want it to. I think my comp is playing tricks on me.

anyone ever deal with some nonsense like this?

Mc.onEnterFrame And Mc.onRelease... Whats The Deal
This is driving me insane. To sum things up, I have 8 dynamically created clips. I'm applying onEnterFrame and onRelease actions to them, but I can't set a variable right for some reason. Simplified example:

code: for (i=0; i<8; i++) {
place["var"+i].onEnterFrame = function() {
if (condition == 8) {
loopallow = true;
}
if (stop != true && loopallow == true) {
for (d=0; d<i; d++) {
addedheight += dir["obj"+i]._height;
}
stop = true;
}
};
place["var"+i].onRelease = function() {
dir._y = -1*addedheight;
};
}

for some reason loopallow comes out right when I call it from within the for loop (the one with d), but not in the onRelease part. This isn't making me very happy.

Whats The Deal With Masking Buttons?
I am having a weird issue with masking a set of buttons.
I have a list of individual buttons in a list all inside a movie clip holder. The buttons are on individual layers.

When I mask the movie clip colder, nothing appears on the published file.

I feel like I've done this before with no issues - yet I cant seem to get this happening.
Thanks
Rich

All My Imported Text Is Going Bold Whats The Deal?
I found a bug in my program and I've figured out how to cause the problem, but I can't figure out what is in the code or the file that is causing it.

Follow this link to see what I'm working on...
http://www.wavemotionstudios.com/haileys

The text in the top left is imported via XML. The XML file has some html tags surrounding the data in each node and when it gets imported into flash, the actionscript combines the html tags in each node all into a string and then that is put into a text box that allows html blah blah blah.

So here's the bug... if you select some of that text, then click on a link to go to a different page, from then on, ALL of the imported text will be BOLD. Does anyone know what could pooossibly be causing something like that? I can post some of the code or some of the XML file to show how I have it setup if that will help.

Whats The Current Deal With Popup Windows In Flash?
Hi There,
whats the current deal with popup windows in flash? I'm trying to include popup windows in a site, and with IE7 (or whatever the newest version of IE is ..the firefox lookalike) the popups are not working at all, I have gone out a gotten other sample popup scripts and I encountering the same problem, which is the popups aren't working at all?
Is this a problem with just IE7 or am i completely missing out on something here?
any ideas would be really appreciated! or if anyone has any scripts for sizeable popup windows that work on IE7 i would really appreciate it. thanks
:}

[f8] Xml, As, Functions - Whats Up
Hi all,

I've been working on this for a while, I'm very new to flash and xml..

I've been trying to change a flash xml playlist to play when the site loads, without having to click play, or any of the playlist items.

I've been told I should use a functions and then call it in.. I'm not sure what that means.

Below is what I've been given:

xml.onLoad=function(){
startPlaying(this)
}


I put this into flash in both my XML layer, and my Sound layer. nothing happend.. I'm assuming I need to add to or change this function to get it to work right.

I can post all my source files as well if that will help get this issue solved.

http://ezekieldesign.com/clientprevi.../wowhmyns.html - here's what I'm working on.. You'll notice you have to click on the track to get it to pull the Nodes data, including the song.

thanks!

Whats The Syntax For Doing Multiple MC Functions On One Line?
like...


Mc1.onRollOver , Mc2.onRollOut , Mc3.onRelease = function(){
lalalalala
}


So all of those do the same thing without having to create many lines?

cause i have a long list things I want it to do, but dont wanna make the list multiple times if i dont have to..

I have it in a function right now, but im curious if you can do that up there.

Deal Or No Deal Calculator Problem
I am trying to make a Deal or No Deal Calculator but everytime I leave the penny in for the last 2 the average amount is a bit off and then when I leave just the penny or every other amount except the million it is a bit off if I leave the penny with that amount. Any Ideas on how to fix it?

Deal Or No Deal Calculator Problem
I have created a calculator for the TV program "Deal or No Deal". It is supposed to calculate the average of the total remaining values. When the penny is one of the remaining values it seems to be a little off for at least when there are 2 cases remaining except when the million is the one left any ideas on how to fix this?

Heres The Deal... Or No Deal
Heres the deal:

I am trying to make the deal or no deal game and am a newbie to flash programming. If you look at the code in the zip file, its obvious whats not working. When I try to create a group of movie clips from an array, it causes a wierd result. If createAmounts(); is commented out, createBriefs(); works fine and vise versa. Someone please help this newbie . Oh ya this is my first post so hi!

Deal Or No Deal Game
Hi, I am trying to work on coding a deal or no deal type game with actionscript however I am having problems since I am new to ActionScript and am just beginning.

What I would like to do is randomize numbers under each box that I have set using attachmovie, so that the values can be different each time. I than want to have it when you click on a box with the values randomized underneath it, the menus either on the left or right of boxes change color depending on what number you pick. Eg: if you got a box with 10 in it, the menu with 10 on it would blank out.

Example here: http://www.unoriginal.co.uk/deal-or-no-deal.html

Anyways if anyone has any idea on how to accomplish this I would indeed be greatful since this is due in a few days for my class. Thanks.

Help With Deal Or No Deal Game
Hi,

In my work I'm going to make a game similar to this one: http://www.nbc.com/Deal_or_No_Deal/game/flash.shtml

I've created a few flash games earlier, based on simpel randomness and some math, but I would still concider me a newbee on game developing. Therefore, could anyone tip me on where to find some useful tutorials that might come in handy while I try scripting a game based on Deal or no Deal?

Lars

Deal Or No Deal Game
Hi, I am trying to work on coding a deal or no deal type game with actionscript however I am having problems since I am new to ActionScript and am just beginning.

What I would like to do is randomize numbers under each box that I have set using attachmovie, so that the values can be different each time. I than want to have it when you click on a box with the values randomized underneath it, the menus either on the left or right of boxes change color depending on what number you pick. Eg: if you got a box with 10 in it, the menu with 10 on it would blank out.

Example here: http://www.unoriginal.co.uk/deal-or-no-deal.html

Anyways if anyone has any idea on how to accomplish this I would indeed be greatful since this is due in a few days for my class. Thanks.

Whats A Good Book For Learning Whats New In MX?
I know flash5 pretty good, but hate the tutorials in MX itself. Whats a good book for learning everything new?

such as the UI and the improved library and dynamic images?

all the rest is the same so I just need to be updated on how to do the new features.

thanks

Here Is The Deal
It is best to have a fire wall if you are going to do this and or a good virus scan.
1.Lauch Lime Wire
2. On lower left hand of screen there is an area with I think 3 radio buttons. Select: "Programs"
3. Then put in query for Macromedia OR Macromedia Flash OR Flash MX OR whatever else you want.
4. Be sure to download files from cable or dsl or T1 or it will take forever. Best to download ones that have numbers next to them too because that means you are downloading from several sites at once and it will go faster...FASTER!
5. That should do it. Problems from here? Doubt it.
Good LUCK

What Is The Deal With This
code: on (press) {
if (main._currentframe == "stoped") {
main.gotoAndStop(1);
}

}


am i doing something wrong? it doesnt work

i am wanting the command to look at my mc named "main" and see if it as on the current frame named "stopped" and if it is, goto frame 1

can someone show me where my problem is?

Deal Or No Deal
im working on a flash that requirs me to move to the next scene but make the object disappear can any body give me ideas

Deal Or No Deal
im working on a flash that requirs me to move to the next scene but make the object disappear can any body give me ideas

Thank you!!!

What's The Deal?
what is the deal w/ pixel fonts? why are they so popular? what are they usually used for? is it b/c they are so easy to read when scaled down so small?

(i can allready hear the sighs from the advanced flash users )

but...I am new to everything....and I still dont understand?

dont be to hard. thank you

What's The Deal With Xml And AS?
why are people using xml and as for photo gallery? the pics are still the same size and they can be loaded from outside the swf anyway with as.so why bother with xml? what s the advantage?

Set Mask. What Is The Big Deal? What Can It Do?
What does set mask do?

If I want to set a mask, I make the layer a mask layer.

Can this tell a movie clip to act as a mask?

Can it then tell it what to mask?


I would like to have the following masking effect...

a bunch of small circles motion tween to larger circles until the entire image is revealed.
Each one of these tweened circles is in it's own movie clip.

How can I achieve this effect?

Thanks.

Loadmovie, What's The Deal?
I've been stuck trying to figure out what is going on with a movie, I'm about to go out of my mind.

a. Index swf loads with 2 empty movie clips (name, name2)
b. index uses loadmovie("file1", name); for the purposes of an accurate preloader.
c. Once file1 is loaded, preloading moves on to file2
loadmovie("file2", name2); for background loading as the first movie plays.

Here's what's going wrong...file1 loads and starts playing, then file two immediately begins playing from inside the movie clip of file1, even though both are independent of each other! (and both are seperate symbols)

For the purposes of trying to find out what was going on I
-deleted all the script and objects relating to file 2
-and even deleted the movie clip file ONE is targeted to, and the file1 movie still mysteriously plays! Shouldn't the movie not play if I deleted the movieclip?

Is there a problem with levels here that I am not seeing? I thought you didn't have to worry about levels when working with loadmovie.

thanks!

Oh, The Deal With Preloaders
O.k I can't for the life of me ever get any preloaders to work, and yes i have been through the tutorials on this site, have downloaded the fla files, inserted and tweaked them in my movies, and i can't get them to work.
The most recent one seems to work fine but the sound has disappeared?
All my movies are completed, i just need a preloader for them. Can someone please explain or send me to a link on how to make preloaders for dummys...

thankyou, much much appreciated

No Scenes...What's The Deal?
I've heard people talk about not using scenes in their flash movies. I'm wondering what the benefits of this are, as well as how you can create an entire flash website and/or presentation in flash without using more then 1 scene? Whats the deal...?

What Is The Deal With Scenes?
Hello,

I am a total newbie with flash and working on my first movie. I have three scenes in the project, each with moving and fading text and a movie clip that fades in and out. For some reason, when I publish the movie the first scene works perfectly, but in the other two, the text moves correctly but the fading in or out does not work. The fading on the movie clip works properly in all scenes. The text properties in the first scene are identical to the other two, as far as I have determined, and i accomplish the fade by changing the tween instance's alpha value between keyframes.

The solution is probably right under my nose but I greatly appreciate any help you can lend me. I will supply any additional information required.

Thank you,

Ben...

What Is The Deal With Test?
I have actually been using Flash for quite a while. I use Flash5 at work and FlashMX at home. Most of the work is simple menu stuff and ActionScripting.

Now after all this time you would think I know the answer to this, but I do not. I am wanting to do work with text. For whatever reason, I notice text does not behave like anything else. For example, I want want to skew the text. So I take a letter, "P" for example, create a new symbol, make it a Movie Clip. Then drag it on stage. Test the movie and all is well.

Then I go back into the movieClip and skew the letter. Test the movie and nothing shows up.

I have run into this using onMovieClip and setProperty as well. What is the trick to making text behave like any other movie clip or graphic.

Is there a particular text option I need to use such as dynamic. I have even given the clip an instance name on stage, gone into actionScript and used onMovieClip(load) and tried controlling that way. Same result. However, I did notice the _x and_y positioning works, but _alpha or _rotation do not.

Very confusing.

Thanks for the help.

AttachMovie: What's The Deal?
I can attach a movie to the root and to 1 movieClip deep, but not 2 movieClips deep. Why? THe code below resides on an actionscript layer (timeline), frame #1, inside the "fromaland" movieClip.

This works...(but not what I want)

Code:
t = _root.fromaland.attachMovie(symbol,"drop"+i++, _root.getNextHighestDepth());
t._x = _root.fromaland.farfarsparkly._x;
t._y = _root.fromaland.farfarsparkly._y;
This does NOT - and is what I want.

Code:
t = _root.fromaland.farfarsparkly.attachMovie(symbol,"drop"+i++, _root.getNextHighestDepth());
t._x = _root.fromaland.farfarsparkly._x;
t._y = _root.fromaland.farfarsparkly._y;
I am having a target clip (farfarsparkly) follow a guide (layer) path.

Thanks.

How To Deal With Very Big Flv Files?
Hi

Anyone knows if there are ways to compress very big flv files?
The flv video file i have is currently about 58MB and the length of the video is 17minutes. The client hopes to play the whole video on his website, are there any methods to help? And what is a reasonable file size for a flv file online?

Deal With Xml Elegantly
I always find dealing with xml is some what ugly in the sense of coding.

For example i need to specify firstChild.childNodes[2]....and so on.
It would be nice if we can retrieve the data like what we do with associative Array or database recordset format.


How you guys deal with xml?

Set Mask, What Is The Big Deal? What Does It Do?
What does set mask do?

If I want to set a mask, I make the layer a mask layer.

Can this tell a movie clip to act as a mask?

Can it then tell it what to mask?


I would like to have the following masking effect...

a bunch of small circles motion tween to larger circles until the entire image is revealed.
Each one of these tweened circles is in it's own movie clip.

How can I achieve this effect?

Thanks.

How To Deal With The BACKSPACE Key
I was wondering about how to be able to prevent a user efficiently from quitting a Flash movie by pressing the BACKSPACE key.

The problem occurs due to the fact that I open up a Flash movie and position the cursor into a textfield, so that the user can enter something. It happens that the user mistypes his name for example and that he then presses BACKSPACE in order to remove the last typed letter. In that case it can happen that the browser reacts (it doesn't happen always, but IE6 shows these problems often) and goes back to the previous page...

Does anyone know a way how to prevent this?

Artimidor

Ever Have To Deal With .js Calling Flash?
If you have had a situation where the HTML calling your flash file is not in the same directory but being creted on the fly by using .js then perhaps you have worked around this issue:

I have one .swf loading another with mc.loadMovie().

both movies are in the same directory.

if the html that calls the main movie is in the same directory everthying works.

If a .js located in someother directory calls it, the main movie can't find the 2nd .swf that is sitting in the same directory.

So instead I use a path from the root of the server.

Now everything works, UNTIL I try it on Netscape 4.7. Other versions of Netscape and IE work great. Under Netscape 4.7 the main movie can't find the 2nd .swf to load.

The specs require I work with Netscape 4.7. Is there a different way I should have done this? How do people get around the problem of the calling HTML not being in the same diretory or being created in some other directory?


Here is the absolute path I gave and how I called it. where "/flash" is a directory at the root and the movie score instance loading it is called "My_Inst"

My_Inst.loadMovie("/flash/test_1.swf");

Any ideas. I solution so far has only backed me into a corner.

Thanks for the help!

Another Space Invaders Deal
This is probably quite simplistic for the most of you, but here goes:
It's the usual space invaders type deal, the spaceship scolls x, the enemies coming down from various random y coorinates. There's a scoreboard (it's var being scoreBoard,
instance name being theScore).
The initial value of the variable score is 0, of course, thus incremented by 200 with each enemy killed. What I'd like to know is this: I want to start an entirely new level when the score reaches----let's just say 5000,
for instance---How do I go about doing this? I've tried various 'if' statements, but I can't seem to get it to work.
Also, the variable score, the scoreboard, that is, is within a dynamic text box. Any help at all would truly be appreciated!

How Does Flash Deal With Pages?
Hi all,
I just want to have dynamic text or a button take me to another flash page. Would I just use Actions/Browser/Network/get URL? I've seen a lot of Flash sites that open a new windows without any menu bars or other junk. How is this done?

Thanks,

How Do I Deal With Compatibility Issues?
Hello Anyone that can help:

I have had my site up and running for about 6 months and did not know that the following users have had trouble accessing my site www.americanhealthsolutions.us:

Macintosh Users with any ISP
Windows Users using Netscape
Various Windows users with different version of IE

Please let me know how I can approach getting this fixed as soon as you can. Everyday I am likely loosing business.

Much appreciated.

TNT

What's The Big Deal Between _framesloaded And GetBytesLoaded() ?
Ok, I have a movie loading in an external movie and before the external movie can be seen I preload it to make sure everything has been loaded in.

I can get it to work testing the bytes that have loaded using the following code:

code:
loadMovie("test.swf", empty.empty2);
preloaderMC.bar._xscale = 0;
empty._alpha = 0;
preloaderMC.onEnterFrame = function() {
empty.empty2.stop();// keep the movie from playing
bytesTotal = Math.floor(empty.empty2.getBytesTotal()/1000);
bytesLoaded = Math.floor(empty.empty2.getBytesLoaded()/1000);
percent = Math.floor((bytesLoaded/bytesTotal)*100);
preloaderMC.bar._xscale = percent;
if (percent == 100) {
empty._alpha = 100;
empty.empty2.gotoAndPlay("go");
preloaderMC._visible = false;
delete preloaderMC.onEnterFrame;
}
};


Now here is the mystery. For my own curiosity (and for a future project) I need to load inthe movie by testing for the number of frames that have loaded. So in my squirrly mind I would think I could use the same preloading engine but replace the bytes testing with frame testing as inthe following code:

code:
loadMovie("test.swf", empty.empty2);
preloaderMC.bar._xscale = 0;
empty._alpha = 0;
preloaderMC.onEnterFrame = function() {
empty.empty2.stop();// keep the movie from playing
framesTotal= empty.empty2._totalframes;
framesLoaded = empty.empty2._framesloaded;
percent = Math.floor((framesLoaded /framesTotal)*100);
preloaderMC.bar._xscale = percent;
if (percent == 100) {
empty._alpha = 100;
empty.empty2.gotoAndPlay("go");
preloaderMC._visible = false;
delete preloaderMC.onEnterFrame;
}
};


Why does the same exact code for testing frames loaded not work but it does work for testing the bytes loaded?

Man, I need help on this one people?

thanks!

How To Deal With Apostrophe's From XML Import
I have a dynamic text box that I create with createTextField. It will recieve data from an XML file. And data with apostrophes are inserting strange symbols in my text box. I've tried setting the text box properties to HTML, as you can see below, but it doesn't help. Is there a solution to this besides editing the XML?


Code:
_root.scrollingTextMc.createTextField("myTitleText", 4, 0, 0, 10, 10);
_root.scrollingTextMc.myTitleText.type = "dynamic";
_root.scrollingTextMc.myTitleText.autoSize = true;
_root.scrollingTextMc.myTitleText.embedFonts = true;
_root.scrollingTextMc.myTitleText.html = true;
//
myformat = new TextFormat();
myformat.color = 0x344139;
myformat.font = "BankGothic";
myformat.size = 18;
_root.scrollingTextMc.myTitleText.setTextFormat(myformat);

How Do I Deal With These Preloaded Swfs? Where Do I Put Them?
Where should I put them? I have a photography site with fifty images. All around 40k. I'll like to load them in right after the main interface loads. But where do I put them. And how do I hide them?

Is it true that if I have a bunch of images alphaed out but on the stage, it would slow everything down, and tax the procesor?

What technique should I use?

Thanks.

What's The Deal With Flash's Mac Interface?
Flash has had a history for being inconsistent with its programs' interfaces across different platforms. But even Flash 8 seems to have the same symptoms of bad interface design as what I'm experiencing in MX 2004! What progress has been made to unify the interface, to make things better?

My PC-toting friends who use Flash have a much more organized system. Their actionscript isn't limited to a clumsy, collapsable palette. (That's my primary beef with Flash right now.) I, on the other hand, have to worry about multiple windows and what might be the most ridiculous system of palettes in any professional software package, save for Microsoft Office.

Can Flash be modified- through an extension, a javascript file, whatever- to be better organized? Please?

How Flash Can Deal With Windows DLL?
Hi,
My Message is about the possibility of Flash to know
1) how Flash can deal with a DLL windows written in C++?
2) or else how to do so that Flash can communicate with the Windows API ?
3) how to create a library that Flash will import via ActionScript?

I am waiting please for your answer.

Best regards.
Fredly

How To Deal With Large Flv Files?
Hi

Anyone knows if there are ways to compress very big flv files?
The flv video file i have is currently about 58MB and the length of the video is 17minutes. The client hopes to play the whole video on his website, are there any methods to help? And what is a reasonable file size for a flv file online?

How Do I Deal With These Preloaded Swfs?
Where should I put them? I have a photography site with fifty images. All around 40k. I'll like to load them in right after the main interface loads. But where do I put them. And how do I hide them?

Is it true that if I have a bunch of images alphaed out but on the stage, it would slow everything down, and tax the procesor?

What technique should I use?

Thanks.

Best Way To Deal With Interlaced Video
I'm shooting a "talking head" video for part of a Flash movie and unfortunately I only have a good consumer-grade dv camera, which seems to record everything as interlaced. I also only have final cut express, which seems also to export everything as interlaced. I hear this is not optimum for video that's going to be streamed over the Web, that is, if you want it sharp.

I'm wondering if anyone knows the best way to make my image sharper. If I import, manipulate, and export it in final cut express larger than needed, but then scale it down significantly in Flash 8 video encoder, will the scaling down make the interlacing less perceptible, similar to scaling down a low-res still image can make it look sharper?

I've heard elsewhere in this forum that using any deinterlacing filter just makes it worse.

Thanks.

Deal With Object's Shape
Hello all,

In AS3, It's pretty easy to modify diferent properties of a object such like .x .y .width etc..

What I am looking for is to change the shape of an object. My goal is to transform a rectangle into a paralellogram or a trapezoid. The ultimate goal is to generate a pseudo-3D effect.

I woud like not to use complex 3D libraries.

In my head, I would see something like:
Modify the .x position of the upper left point of my movieclip by 10px.
Modify the .x position of the upper right point of my movieclip by 10px.

Thanks for your answers by advance.
Cheers,

GS

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