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




Advanced Actionscript/Javascript Code Question



This is beyond the limit of my coding knowledge, so I thought I'd ask some people here.

I'm trying to write code to open -via buttons, from a flash navigation- separate browser windows, the size and features of which I can precisely control. In the past I have used javascript to open a single controlled window through flash, and I have used javascript *not* in flash to open multiple controlled windows - now I need to do both together. Also, to try to be less confusing, I don't mean open multiple windows off one button, I mean different window controls for different buttons.

ie the following:
press button 1 to open a 400x200 window
press button 2 to open a 500x300 window
press button 3 to open a 200x200 window
etc

I've seen it done before, but haven't been able to troubleshoot my way through (don't think I haven't tried, though - probably close to 7 or 8 hours over the weekend)



FlashKit > Flash Help > Flash ActionScript
Posted on: 09-23-2002, 12:26 PM


View Complete Forum Thread with Replies

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

Advanced Code Help
Hi, I wondered if anyone might want to take a look at my problem, its a menu, I want to stick with it because it is so versatile, it calls the urls, frame destination and number of menu items from a text file. The code is very efficient and has been quite a challenge to get it to work. The problem itself is to get the menu to open when it has loaded, instead of a rollover. If any one is interested they can e-mail me below and I can return with the files and a description of the file.

Test link
http://www.adwright.net/pga/test/indexmain.htm

martin@adwright.com

Advanced Code Help
Hi, I wondered if anyone might want to take a look at my problem, its a menu, I want to stick with it because it is so versatile, it calls the urls, frame destination and number of menu items from a text file. The code is very efficient and has been quite a challenge to get it to work. The problem itself is to get the menu to open when it has loaded, instead of a rollover. If any one is interested they can e-mail me below and I can return with the files and a description of the file.

Test link
http://www.adwright.net/pga/test/indexmain.htm

martin@adwright.com

Need To Do An Advanced AS3.0 -> Php Code
Basically what I have is a flash application that will have multiple text fields on the stage. It will be set up like a business card, and the user will choose a background template, and type in their information. The user will 'submit' and Actionscript will use AlivePDF, and generate the card into a PDF.

Now my problem is, HOW do I get the text part of this to work. I assume it is through a php code, probabley similar to how a Email form works. I just cant wrap my head around how I basically tell the code "Whatever the user types into the field will be put onto the pdf, and at this posistion."

Advanced Preloader Code Help.
hey, has anyone got the book flash 5 bible? If you have if you look on page 564 of the book. its has the code...

-------------------------------------------------------
loadedBytes = _root.getBytesLoaded( );
totalBytes = _root.getBytesTotal( );
if (loadedBytes < totalBytes){
percentageOutput = int((loadedBytes / totalBytes) * 100);
_root.loaderBar._xscale = percentageOutput;
gotoAndPlay("preload_loop");
}
else{
gotoAndPlay("begin_movie");
}
-----------------------------------------------------
I made the preloader fine and the preloader displays the percentage value of how much is loaded, but...it doesn't show the % (percentage) sign! How do I add that in!? Cheers!

Blue Dragon

ADVANCED: Undocumented Code ... Anyone?
does anyone know of a way to call a flash function using css ... much like you do with asfunction in html ... trying to solve the I want to call a function upon rollover on a href tags problem ..

someone else on this forum wrote the below code:


//Start of Code
my_tf = name of text field;

css = new TextField.StyleSheet();
css.setStyle('a:hover',{color:'#FFFFFF'});
css.setStyle('a:active',{color:'#FFFFFF'});

nothing = function(){};
my_tf.html = true;
my_tf.selectable = false;
my_tf.htmlText = '<a href='asfunction:nothing'>'+my_tf.text+'</a>';
my_tf.styleSheet = css;
//End of Code


am wondering if you could put a call to flash function (just where the text color is being assigned as white) ... thought there might be something undocumented .. just like asfunction was at first .. good one to get the brain juices flowing ??? ...

How To Code Advanced Buttons Propertly?
Hello everyone,

I am running into few issues with my site and would really appreciate any input. First question is I have a navigation bar with a series of buttons on it. When you rollover any other these buttons there is and action on them saying :

on (rollOver) {
this.gotoAndPlay("over");
}
on (rollOut) {
this.gotoAndPlay("out");

on (press) {
_root.main_menu_mc.features_button_mc.enabled=fals e;
this.gotoAndStop("out")
}

Now I want to create some AS that when a button is click and disabled and then the user clicks on another button all buttons will reset themselves and play "out" if they were previously clicked (enabled=false)

So in the end I am just looking to say "Hey flash if a button 1 is clicked and disbaled and then button 2 is click then button 1 needs to enabled itself and play "out".

I am open to any clean proper ways of coding this. I am trying to become more clean and intuitive with my AS so any suggestion would be great. THANKS!

Advanced External Swf Load Problem (if MC Is Empty Code)..
let's say I have on the last frame of my external swf code like this:

unloadMovie(this);
// I think this should unload my external swf from my main movie

And now in my main movie I want to check if my container is empty.. if it is.. let's go to some other frame..

if (container == 0) {
main.gotoAndPlay(2);
}
//I was just hoping that this code checks if the container is empy.. and sends the main movie to frame 2 ..

maybe here are another ways to go.. so pls help me..

hope I was clear enough..

Advanced External Swf Load Problem (if MC Is Empty Code)..
let's say I have on the last frame of my external swf code like this:

unloadMovie(this);
// I think this should unload my external swf from my main movie

And now in my main movie I want to check if my container is empty.. if it is.. let's go to some other frame..

if (container == 0) {
main.gotoAndPlay(2);
}
//I was just hoping that this code checks if the container is empy.. and sends the main movie to frame 2 ..

maybe here are another ways to go.. so pls help me..

hope I was clear enough..

***VERY ADVANCED ACTIONSCRIPT***
Ok, so i exagurate the title... (sp??)

Hey everyone, you might not know me because i havent been around for quite a while now... thats because i almost completely been wiped out of free time. Anyways, I need help and that is why I am here.

Here is the problem:

I am trying to make an object that is basically an array with some extra properties, parent, and child... anyways its not exactly those values, but what i want to do is kind of like:


Code:
// inside an mc
Array.prototype.parent = this;


except instead of that, i want an Object that inherits all of the properties/methods of an array and then add a few of its own. Inheritance in actionscript is not clearly explained, so I ask you for help for anyone who has actually experienced it.


Code:
function advancedArray()
{
this.prototype.__proto__ = Array.prototype.__proto__; // cant get it to work. invalid??
this.prototype.name = function () { return this._name; } // works

// private
this._name = "";
}


In the above example, I TRIED to make an advanceArray that calls the prototype of an array and then add one method to it. Is there any way to do that or am i just confused and sleepy??

Please let me know. Thanks.
-MoMad

Advanced Actionscript Help
The Game:

I have a game where you need to catch the good guys and dodge the bad guys, but the bad guys duplicate when you get a good guy, along with the good guy moving to a new place on the field.
THE GAME IS 100% API

The Setup:

I have a variable "i" with the value of 1.

I have 2 hitTest if statements for hitting the good/bad guys:
(*note* genGood is a function I made to generate a new good guy in a random spot)

if (good.hitTest(mc)) {
i++;
removeMovieClip(good);
genGood();
duplicateMovieClip(enemy, "enemy" + i, 100 + i);
_root["enemy" + i]._x = random(stageX - 10);
_root["enemy" + i]._y = random(stageY - 10);
}

And here's the other one:
(endGame is a function I made to make the ending screen, replay button, etc.

if (_root["enemy" + i].hitTest(mc)) {
removeMovieClip(mc);
removeMovieClip(enemy);
removeMovieClip(good);
endGame();
}


The Problem:

Everything works great except for one thing, getting killed.
It keeps duplicating the enemies whenever I get the good guy, but when I hit one of the enemies, nothing happens. The only enemy that I hit to give me a gameover is the most recently created one.

I know why it's happening but I just don't know a solution. The reason it's happening is because I wrote:

if (_root["enemy" + i].hitTest(mc)) {

That script is saying that if 'mc' hits 'enemy'+i. 'enemy'+i would be what ever 'i' currently is. So you can be killed by enemy3 when 'i' is 3, but when 'i' is 4, you can't be killed by enemy3 anymore, only enemy4.

I want you to be able to be killed by any of the enemies.

So finally, does anyone know how I could make you be killed by any enemy, rather than just the one that ends with the current value of 'i'???

Advanced Actionscript With XML
I am producing a dynamic hierarchical personal chart like this one:
http://www.sageassociates.co.uk/chart1.html

The chart is dynamically created from an XML file that contains the parent child relationships for all of the nodes. This is the result:
http://www.sageassociates.co.uk/spider_04.swf

The problem i am having is that i need to create an engine that avoids the boxes overlapping allowing me to create a layout similar to my first example. The chart should have an organic feel to it allowing the user to move boxes around and it recalculates the avalibe white space and rebuild the diagram.

Also if a user clicks on a box, the engine would need to move everything that is not related to it off the screen, zoom in and move the related boxes around the box.

Has anybody done this sort of thing before, or has the maths knowledge to help me work it out.

Source file here: www.sageassociates.co.uk/Spider.zip
Many thanks

Glenn

FREE CODE: Advanced Techniques| Drop-down Menu .as File - Any Array
formatting is a little messed up but...


Code:
function dropDownList(whichArray, whichClip, label, howHigh, howWide, space) {
//
theStyle = new TextFormat();
theStyle.leftMargin = "4";
theStyle.color = 0x000000;
theStyle.bold = false;
theStyle.bullet = false;
theStyle.underline = false;
theStyle.align = "left";
theStyle.font = "Arial";
theStyle.size = 10;
theStyle.embedFonts = false;
//
eval(whichClip).createEmptyMovieClip("listBox", 3);
eval(whichClip).createTextField("selection", 2, 0, 0, howWide, howHigh);
eval(whichClip).selection.selectable = false;
eval(whichClip).selection.text = label;
eval(whichClip).selection.setTextFormat(theStyle);
eval(whichClip).createEmptyMovieClip("mainButton", 1);
//
eval(whichclip).mainButton.beginFill(0xFFFFFF, 100);
eval(whichclip).mainButton.lineStyle(0, 0x000000, 100);
eval(whichclip).mainButton.lineTo(howWide, 0);
eval(whichclip).mainButton.lineStyle(0, 0x000000, 100);
eval(whichclip).mainButton.lineTo(howWide, howHigh);
eval(whichclip).mainButton.lineStyle(0, 0x00000, 100);
eval(whichclip).mainButton.lineTo(0, howHigh);
eval(whichclip).mainButton.lineStyle(0, 0x000000, 100);
eval(whichclip).mainButton.lineTo(0, 0);
eval(whichclip).mainButton.endFill();
eval(whichclip).mainButton.useHandCursor = true;
//
eval(whichClip).mainButton.onPress = function() {
this._parent.listBox._visible = true;
};
//
for (i=1; i LESSTHAN whichArray.length+1; i++) {
newBox = "button"+i;
eval(whichClip).listbox.createTextField(newBox, i+(whichArray.length+1), 0, space*i, howWide, 20);
eval(whichClip).listbox[newbox].text = whichArray[i-1];
eval(whichClip).listbox[newbox].background = false;
eval(whichClip).listbox[newbox].selectable = false;
eval(whichClip).listbox[newbox].setTextFormat(theStyle);
//
newButton = "button"+i;
eval(whichClip).listbox.createEmptyMovieClip(newButton, i);
eval(whichClip).listbox[newbutton].usehandcursor = true;
eval(whichClip).listbox[newbutton]._y = space*i;
eval(whichClip).listbox[newbutton].beginFill(0xFFFFFF, 100);
eval(whichClip).listbox[newbutton].lineStyle(0, 0xFFFFFF, 100);
eval(whichClip).listbox[newbutton].lineTo(howWide, 0);
eval(whichClip).listbox[newbutton].lineStyle(0, 0x000000, 100);
eval(whichClip).listbox[newbutton].lineTo(howWide, howHigh);
eval(whichClip).listbox[newbutton].lineStyle(0, 0x00000, 100);
eval(whichClip).listbox[newbutton].lineTo(0, howHigh);
eval(whichClip).listbox[newbutton].lineStyle(0, 0x000000, 100);
eval(whichClip).listbox[newbutton].lineTo(0, 0);
eval(whichClip).listbox[newbutton].endFill();
eval(whichClip).listbox[newbutton].data = (i-1);
eval(whichClip).listbox[newbutton].month = whichArray[i-1];
//
//
eval(whichClip).listbox[newbutton].onRollOver = function() {
colorRollover(this);
};
//
eval(whichClip).listbox[newbutton].onRollOut = function() {
colorRollOut(this);
};
//
eval(whichClip).listbox[newbutton].onPress = function() {
colorPress(this);
this._parent._visible = false;
this._parent._parent.selection.text = this.month;
this._parent._parent.value = this.data;
eval(whichClip).selection.setTextFormat(theStyle);
};
//
eval(whichClip).listbox[newbutton].onRelease = function() {
colorRollover(this);
};
//
eval(whichClip).listbox[newbutton].onReleaseOutside = function() {
colorRollOut(this);
};
//
eval(whichClip).listbox[newbutton].onDragOut = function() {
colorRollOut(this);
};
//
eval(whichClip).listBox._visible = false;
}
}
//
function colorRollover(what) {
myColor = new Color(what);
myColorTransform = new Object();
myColorTransform = {ra:'100', rb:'-72', ga:'100', gb:'-72', ba:'100', bb:'-72', aa:'100', ab:'0'};
myColor.setTransform(myColorTransform);
}
//
function colorRollOut(what) {
myColor = new Color(what);
myColorTransform = new Object();
myColorTransform = {ra:'100', rb:'0', ga:'100', gb:'0', ba:'100', bb:'0', aa:'100', ab:'0'};
myColor.setTransform(myColorTransform);
}
//
function colorPress(what) {
myColor = new Color(what);
myColorTransform = new Object();
myColorTransform = {ra:'100', rb:'30', ga:'100', gb:'10', ba:'0', bb:'0', aa:'100', ab:'0'};
myColor.setTransform(myColorTransform);
}
you'll have to change "LESSTHAN" to the propper symbol, but overall, this makes a fun dropdown menu.

Just create an empty MC wherever, and instance name it whatever, then call the function like:

Code:
dropDownList(myArray,whatever,"label",20,100,20);
you can access the selection (after it had been made) like this

Code:
trace(whatever.data);
enjoy

tutash

Advanced Preloader Actionscript
In the following preloader actionscript (that I got from this site), how do I tell target to go to a certain frame in the next scene and play?

loadedbytes=getBytesLoaded();
totalbytes=getBytesTotal();
loadedkbytes=Math.ceil (loadedbytes/1000);
totalkbytes=Math.ceil(totalbytes/1000);
if (loadedbytes == totalbytes) {
nextScene ();
}
frame = int(loadedbytes/(totalbytes/100));
tellTarget (_root.loader) {
gotoAndStop (_root.frame);
}

Currently, I gather that the script is saying at the end, 'go to frame 100 of the next scene and stop'.

How do I change this?

Thanks,

MethodAir

Actionscript For Advanced Preloader,
hey!
I have tried to make the advanced preloader soooo many time its not funny!

i know how to make a simple preloader. such as if last frame of the last scene is loaded goto and play frame 1 of scene 1. But How can I do that with a % loader bar...
for example. for frame 1 what will i put in the actionscript box when i want it to see if frame 95 of scene 1 is loaded if so goto then next frame on the loader bar scene etc. mines just does not work! can some1 tell me how??? maybe a quick FLA file pulllllease???? my email is
amit_kapadia@msn.com
cheers people, thanks for your time.

Advanced Preloader Actionscript Help
well, i have never used actionscript in my entire life untill now....i am working on a preloader and learning from the tutorials section in fk. in the tutorial, some codes were given like "loadpercent" and i tried to insert that code in the scene put i could not find any place where loadpercent was there.

this are the codes i need to use:

Code:
loadpercent = "0%";
loadBytes = "0 of " + Math.round((_root.getBytesTotal() / 1024) * 1000) / 1000
+ " Kb";

and:

loadPercent = (Math.floor (_root.getBytesLoaded() / _root.getBytesTotal() *
100) + "%");
loadBytes = (Math.round((_root.getBytesLoaded() / 1024) * 1000) / 1000 + " Kb
of " + Math.round((_root.getBytesTotal() / 1024) * 1000) / 1000 + " Kb total Loaded.");

and also:

this._xscale = ((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
there are other codes like gotoandplay and i was able to find that under basic actions but actions such as loadpercent and all, that i was not able to locate from the actions menu. what do i do?
for more information go to this link:
Creating an Advanced Preloader in Flash
i understand everything else put i dont know how to insert the actionscript if it aint in the actionscript menu. help please!

Advanced Actionscript Needed
inside the fla i have a layer called "nav".
inside there are my buttons, on the "under layer"
and a mc, on the "blue" layer.

right now the mc plays constantly, i want it to start at a certain
frame (5) when you rollover from button to button. But i only want it
to play when the "nav" is moving.

and to top it off after the "nav" stops moving or you rollout i want
the animation to gotoandstop on the closest frame in the "blue" layer,
either frame 5 or 10.

the fla

Thanx,

New Problem, Advanced Actionscript Only
Can anyone go to this link. I am so tired I can't repost the questions. Can someone help me out on my trajectory questions, its a NEED for me. I must know how! Please?

Struggling With Advanced Actionscript...
I'm a webdesigner, and not so good at code. I was inspired by Neaves Imagination script.

Code: http://code.google.com/p/neave/downl...magination.zip

Example: http://www.neave.com/imagination/

I'm trying to implement it as an ambient illustration in a site, my goal is to get it to either run with a transparent background, or i'll have to scale a one pixel wide gradient PNG that is the site background as the canvass background. Currently it runs as a black background, but I can get that color to change by editing the hex values below.

Because of the advanced actionscript nothing I know works, and I'm a code hacker-arounder not a programmer. I think I have it isolated to line 20 of NeaveImagination.as but I don't know what to do. I have tried changing:


Code:
bmp = new Bitmap(new BitmapData(sw2, sh2, false, 0x00000000));
and


Code:
blackBitmap = new BitmapData(sw2, sh2, false, 0xFFFFFFFF);
by playing with the first two digits of the hex which I read might affect transparency, I also tried removing this function, and various other things you might expect an actionscript-idiot-css-writer to try. From what I can see its using these two sections to create bitmaps to draw the effects into...


Code:
/**
* Sets up the main bitmap
*/
private function initBitmap():void
{
// Stage sizes
var sw:int = stage.stageWidth;
var sh:int = stage.stageHeight;
var sw2:int = Math.ceil(sw / 2);
var sh2:int = Math.ceil(sh / 2);

// Create the main bitmap to draw into (and half the size to run faster)
bmp = new Bitmap(new BitmapData(sw2, sh2, false, 0x00000000));
bmp.smoothing = true;
bmp.scaleX = bmp.scaleY = 2;
bmp.x = (canvasWidth - sw) / 2;
bmp.y = (canvasHeight - sh) / 2;
container.addChild(bmp);

// Create bitmap data for fading into black
blackBitmap = new BitmapData(sw2, sh2, false, 0xFFFFFFFF);
//blackBitmap =

// Bitmap is moved over into position then halved in size to run faster
m = new Matrix();
m.translate(-bmp.x, -bmp.y);
m.scale(0.5, 0.5);

// Origin and blur filter
p = new Point(0, 0);
blur = new BlurFilter(4, 4, 1);
}
Can anyone point me in the right direction, I would be much obliged...

Color Advanced By Actionscript ?
is there an actionscript command to get the same effect you get when you use physically the color Advanced in the prroperty panel ???

Advanced Actionscript Books
Hi,

I've been programming actionscript for some years now, but I'm self taught and I thank I sometimes could do thinks better and more professional if I had the knowled. I've been looking for some advanced actionscript 2.0 books, that is books that skip all the basics and does not start by explaining what a variable is.

Been looking at "Essential ActionScript 2.0" by Colin Moock but else from that I can't find any interesting.

Does anybody here know some good and advanced AS2 books, they can recommend?

: ) Jakob

Desperate For Some Advanced Actionscript Help
Good day all! I've had this problem for some now and I cant get the code to work right. You can get the .fla here>http://thedesignport.com/Help/Final(Flash8).fla< this is the flash 8 version of the file and heres CS3>http://thedesignport.com/Help/Final.fla< and heres the xml file I'm using>http://thedesignport.com/Help/New_images.xml<.

So this is the problem. I have a bar to the right you scroll over it and it slides out. The thumbnails are loaded for the xml sheet (just add you own images to see it work). Now if you click on an img its spoused to load the bigger version of the image to left of the bar. But it doesn't. And the thumbnails are spoused to scroll up and down. I had this working when I was just using a MC for the thumbnails but I wanted to have the all imgs working from the xml sheet to save time, size and future modifications. You'll see the left/ right arrows bottom right the move you on to the next img and back, that works fine.

I think the problem lies in the faked that the thumbnails are inside a MC and I cant get the code right to tell the thumbnails to load the pictures into the "empty_mc" on the _root. And I cant get the thumbnails to scroll up and down.

Any help would be great as I want to put this to bed.

Thank you all!

Advanced Actionscript Functionality
Hello All,

I am working on a project I need to have these key functionality features:
Scrolls an image left to right
Allows users to mark in a pen like fashion over top of the image
High lite certain areas with semi transparent boxes
Saving the flash file after they add there markings would not be necessary but would be a nice feature

How hard would it be to re-create these key functionality items and is there anything already out there has most of this functionality built in that could be modified to meet my needs?

Thanks in advance for all of your help
James

Really Advanced Actionscript Question
Dear All,

I am busy building a website for a friend of mine. I have some hard and advanced coding questions.

He wants to have a top menu and a down menu. The top always has to stand at the top of the browser and the down one (you can guess :D) at the downsite of the browser.
When the browser in- or decreases in size they also go to the top and down site. This worked out nicely with the class of Summit :).

Now we head of to the tricky part:
1.
Between the top menu and down menu there is a gap (big or small depending on the browser size). In this space he wants to have text always font size 12.

2.
But, the amount of text also needs to adjust on the browser.
For example; on a small sized browser you will have two pages text. On a big it will only be one page.

3.
A button needs to appear and disappear to click through on a small sized browser.

4.
Second problem is the alignment, he wants this alignment:

/// Top menu \

Hello______bla bla bla bla bla bla bla bla bla bla bla bla
Hello______bla bla bla bla bla bla bla bla bla bla bla bla
Hello______bla bla bla bla bla bla bla bla bla bla bla bla
Hello______bla bla bla bla bla bla bla bla bla bla bla bla
Hello______bla bla bla bla bla bla bla bla bla bla bla bla
Hello______bla bla bla bla bla bla bla bla bla bla bla bla
Hello______bla bla bla bla bla bla bla bla bla bla bla bla
Hello______bla bla bla bla bla bla bla bla bla bla bla bla
Hello______bla bla bla bla bla bla bla bla bla bla bla bla
/// Down menu \

Still get it? :?

Does anyone has an idea how to build this:?: How should I code this:?: Should I use an external text file:?: Does anyone have any experience with these kind of features:?:
Respectfully,
Michel

Best Intermediate/advanced Actionscript Book?
Im interested in purchasing a couple of books on actionscript and have a decent knowledge of programming principles and am familiar with flash 5 actionscript...

....However Im giving serious considering to taking the Flash certification exams and would like some DECENT recommendations as to which books to buy.

Advice please

Good Advanced Actionscript Book?
Does anyone know of a good advanced actionscript book for MX that's been published?

I'm after a book which just focuses on actionscript programming, something like ActionScript: The Definitive Guide by Colin Moock but for Flash MX.

Advanced Customisation Of The ActionScript Editor
Is it possible to customise the ActionScript editor's syntax colouring so that I can specify a colour for a specific words such as 'myNewCode'? I'd like to be able to do this as I'm working on a file developed by another developer and I need to be able to quickly find my changes to the original code.

Many thanks

NB. Please could any replies only answer this specific question and not suggest alternative methods as I am aware that there are other ways to find my new code.

Uploading To Database(advanced Actionscript)
Is there a script for uploading information to a database, such as MySQL, that's what I have for my website. Cuz, for my games, I want it so that people can save, and then their stats go up into the site. Every time they save and something changed, it would change on the database. I can think of parts of the script, but not the whole thing. Can anyone help me?

[F8] Actionscript Advanced Colour Change
Hi,

Actionscript dummie here!

I know you can change the colour of a movie clip using action script such as:


Code:
on (release) {
col = new Color(mcName_mc);
col.setRGB(0x0099FF);
}
But is there a way of fading the colour in and out rather than the immediate changethat this code provides?

For example instead of using the on (release) function I use the on (rollover) and on (rollout) funtions?

Newbie Needs Urgent Help With Advanced Actionscript
Hi all,I got this sch project that involves 5 choices - A, B, C, D, E. These choices are engine components such as crank, conrod, piston.etc.

So the user will choose out of these 5, any combination with the min. being 2/5 and max is all 5. When user chooses his/her selection, another input box would appear beside each choice asking for relevant details such as revolutions per minute for a crank, vertical distance travel of piston, length of conrod whatever. When he press a forward button, a diagram of the another component, E, in this case a cam, that is required would show as well as a specifications list of the cam. Believe this should b from a library.

I am like a total newbie but I have been "volunteered" to do this assignment. I was wondering if its possible and how do I go abt doin it.I tried reading up on actionscript but got overwhelmed. Any help would be most appreciated and I willing to pay but ultimately, I would like guidance more than anything else. Thanks

Animating (Advanced) Colour With Actionscript.
Can anyone walk me through how to animate the colour of a movie clip using actionscript? i.e. in the way 'Advanced' lets you add/shift colour values per channel (in the Properties panel).

Looking for the easiest way possible.

Thanks heaps in advance.

ActionScript Preloader/Advanced Question
Here's my actionscript:

//-----------------------------------------------------------------------------------

// state variables

var total = getBytesTotal();
var loaded =getBytesLoaded();

// Create the Load Bar

var loadBar:MovieClip = createEmptyMovieClip("loadBar", getNextHighestDepth());
loadBar._x = 200.0;
loadBar._y = 370.0;
loadBar.lineStyle(2, 0x000000, 100);


// create housing clip

var container:MovieClip = createEmptyMovieClip("container", getNextHighestDepth());
var con:MovieClipLoader = new MovieClipLoader();
var conL:Object = new Object();

//create the onLoad progress

conL.onLoadProgress = function(target, loaded, total) {
percent.text = Math.round((loaded/total)*100)+"%";
loadBar.lineTo((int((loaded/total)*100)),0);
};

//call these actions once loaded

conL.onLoadInit = function() {
loader.visible = false;
loadBar.visible=false;
percent.text = "";
};

con.addListener(conL);
con.loadClip("3.jpg", container);
//---------------------------------

Everything works the way I want it to, except for the loadbar; it doesn't scale or move when an image is loading. So, I need it to scale to show the load progress in addition to the text percentage...so that's my issue...the loadbar showng the download progress....and once the image has fully downloaded, I need the loadbar to be invisible, removed, or deleted ....any assistance would be grand...

Best Book For Learning Advanced Actionscript?
Basically, I want to be able to put something together that's as good as http://www.creaktif.com/ or http://www.leoburnett.com/ . (I'm aiming high, aren't I!!)

I know my way around Flash, the timeline, drawing and effects, layers, motion/shape tweening, and can do basic Actionscript.

Any recommendations for books to wisen up and be able to create a comparably respectable website within a couple months time? I'm not looking for an 'instant solution', just a good resource to aid me in the learning process.

I'm assuming it took server-side programming of some sort, or at least reading from an XML file to be able to put some parts of the Creaktif site together, and I need to learn about that too.

I prefer books to online tutorials, but if anyone knows of any online tutorials that they really like, post those here too.

Cheers to anyone who takes part, just though this would make for good discussion/reference and help me out at the same time!

P.S: this point is a little off-topic, but I found a website a long time ago that featured user submitted Flash scripts and the FLA file so you could have an explore. There was some really good stuff on there... but I lost the bookmark a while back! It had a black background, and animated header. The colour scheme was dark. It was really modern, and well put together, obviously by some people as skilled as those that created the Creaktif or Leo Burnett sites. Called 'Shockwave' or 'Swf.......' or something... if you know of something that seems similar to what I'm talking about, maybe you've found it! I'd appreciate a link to the site an incredible amount you have no idea. Before I lost the bookmark about six months ago, it helped me a lot in the learning process.

ActionScript Preloader/Advanced Question
Here's my actionscript:

//-----------------------------------------------------------------------------------
// Create the Load Bar

var loadBar:MovieClip = createEmptyMovieClip("loadBar", getNextHighestDepth());
loadBar._x = 200.0;
loadBar._y = 370.0;
loadBar.lineStyle(2, 0x000000, 100);

// state variables

var total = getBytesTotal();
var loaded =getBytesLoaded();

// create housing clip

var container:MovieClip = createEmptyMovieClip("container", getNextHighestDepth());
var con:MovieClipLoader = new MovieClipLoader();
var conL:Object = new Object();

//create the onLoad progress

conL.onLoadProgress = function(target, loaded, total) {
percent.text = Math.round((loaded/total)*100)+"%";
loadBar.lineTo((int((loaded/total)*100)),0);
};

//call these actions once loaded

conL.onLoadInit = function() {
loader.visible = false;
loadBar.visible=false;
percent.text = "";
};

con.addListener(conL);
con.loadClip("3.jpg", container);
//---------------------------------

Everything works the way I want it to, except for the loadbar; it doesn't scale or move when an image is loading. So, I need it to scale to show the load progress in addition to the text percentage...so that''s my issue...the loadbar showng the download progress....and once the image downloaded, I need the loarbar to be invisible....any assistance would be grand...

Knowledge Test - Advanced ActionScript
Hi everyone,

My name is Gil Cohen, I'm the webmaster of a site called Flashoo :: The campus for Israeli Flash developers. Recently I developed a test application which contains 20 (some will say difficult) questions conncerning Action Script. The test got many positive feedbak in Israel so I translated it to English, so that more developers around the globe can enjoy it. So, if you think you're up to the challenge:
Start the test

Good Luck !

Advanced Actionscript Question - $$$$ For Whoever Solves Problem...
Here is the problem...

When a user rolls over one of the links on the nav
bar a menu should slide down into view. When they
roll off, the menu should retract. Currently I am
using the onClipEvent command and that is most likely
my problem. I have spent four days on this problem
and I REALLY could use some help with this. Hell
I dont even mind flipping someone a reward for
assisting me with the problem..I am that desperate
to understand what I am doing wrong! Below is a link
to the disgruntled fla file. Anyone who can help me
with this...I will personally send a token of my appreciation
to.

Regards.......mmaler

http://www.stellarproduction/interface.fla

Good Moderate/advanced Actionscript Book
hey all. i'm looking for a good moderate-to-advanced actionscript book. i'm very fond of the friendsofed books - i really like their writing style. the 24 hour books bore me. i was thinking of picking up actionscript studio, but that was written for flash 5 and i'd like to get something geared towards MX. i know friendsofed is coming out with a actionscript dictionary for mx, but i didn't know if it was just going to be a reference or an actual learning tool.

thanks!

Advanced Actionscript? Problem W/stage And Scaling
This is what I want to do:
1) have a "holder" swf that contains the background img and SCALES to fit the browser window.
2) have the "main" swf inside the holder that DOES NOT SCALE with the holder.

An example can be found here:
www.olivier-baldissera.com

so far I've been able to scale the holder to fit the window as I wanted using the "noborder" and 100%x100% html attributes. I've been fooling with the stage.onResize function and listeners, but they don't seem to work right, partly because I don't think they're supposed to be used with "noborder" set to true.

PLEASE HELP!

Actionscript For Tweening Advanced Color Settings?
Hello!

Is it possible to use actionscript to tween the advanced color settings in a movieclip? I'd like to tween a picture from 0 to 255 (R, G, B, A) and then back to normal. I can do this using the timeline, but I would love to learn how to do with with actionscript instead.

I'll attach an example to this posting of the effect I'm trying to create.

Thanks!

[F8] Movieclip Actionscript Advanced Colour Control
Hey, i have made some colour sliders, so i can use actionscript to change the colour of the movieclip, but I dont just want to change the whole colour of the movieclip, I want it to keep its tones, as would happen if you used the advanced colour tool within flash.

Thanks for any help or suggestions.
Harro

Help Wanted To Create Advanced Portfolio In Actionscript
Hi
Myself Vimal here. I am a web designer, but I am a novice in flash actionscripting. I need your help!.

I am planning to build an online portfolio of all my works. This is what I have in my mind right now.
http://www.geocities.com/staticycreations/portfolio.jpg

I would like to generate the list of sites and the image from an xml file. The reason is because in future I may not have flash but still should be able to update my gallery. I can edit the xml file though.

Could you guys please advice me of a better way of doing this or give me some links where I could find similar tutorials ? I have searched in google a lot and also went to some famous tutorial site like flashkit and kirupa.
http://www.kirupa.com/developer/mx20...otogallery.htm
This one is the closest I could find !...

Please help me guys,

Thanks a load in advance!

Best Regards
Vimal
Web Designer

Advanced Actionscript? Problem W/stage And Scale
This is what I want to do:
1) have a "holder" swf that contains the background img and SCALES to fit the browser window.
2) have the "main" swf inside the holder that DOES NOT SCALE with the holder.

An example can be found here:
www.olivier-baldissera.com

so far I've been able to scale the holder to fit the window as I wanted using the "noborder" and 100%x100% html attributes. I've been fooling with the stage.onResize function and listeners, but they don't seem to work right, partly because I don't think they're supposed to be used with "noborder" set to true.

PLEASE HELP!

Advanced Button Question: Actionscript Placement
Hi I was wondering what kind of methods you guys use to place your action script when creating the over down states of a button. The tutorial I am reading says you should put all your code on 1 frame on the main time line. But I was thinking wouldn't it be better to place the action script code for the button states in the timeline inside of each button movie clip?? since it doesn't really change? it seems like all the functions for a button should be contained in its own movie clip. but since im a noob, I have reached a point yet where I go "dam, I wish I would have done this the right way."

Button And MC Navigation Problem. Advanced Actionscript Question..
I am having a problem with a navigation system that I am trying to create. The general concept of the nav is that
when a user rolls over any link on the nav bar a menu
slides down. When they roll off the menu retracts. The
problem that I am having is that when they roll from one
link to another the motion on the previous link just stops.
I want to set it up so that if they move from one link
to another each animation cycle of the menu expanding and retracting completes. Here is the code I am using...

Button:

on (rollOver) {
gotoAndPlay ("menuSlideBegin1");
}
on (rollOut) {
gotoAndPlay ("menuSlideEnd1");
}

MC:

onClipEvent (load) {
_root.navMenu1._y = -120;
endPosy = 78;
}
onClipEvent (enterFrame) {
currentPosy = _root.navMenu1._y;
diffPosy = endPosy-currentPosy;
movey = diffPosy/3;
_root.navMenu1._y = _root.navMenu1._y+movey;
}



I appreciate anyones help....

Advanced Flash ActionScript: Master Mind (game)
If anyone out there is really good at actionscript I could use their help!!!
I'm not in trouble yet, but I probly will be soon

I'm attempting (note: attempting) to make a game like Master Mind
(a game where the computer randomly picks a sequince or colors and the user has to guess the pattern by guessing colors and the computer tells them how many colors are in the correct slot and how many colors are right but are in the wrong slot.) heh sounds complicated and it is...
So ill be in trouble soon so i was just wondering if anyone knows how to do this easily Id love to know!

Thx in advance

Please HELP A DUMB Person With Advanced Actionscript Blinking Problem
First// this is what I have, a circle that blinks with actionscript

Question: How would I make the script below stop from making the circle blink using a button on the main??? I would like to do it with script..

1.I tried a MC with the blink script in the over state of the button and it does not blink.

2.I made a button on the main and targeted a MC
named blink. The blink MC has 2 frames
the 1st frame is blank with a stop
the 2nd frame has a stop, the script that
makes the circle blink and the circle
On the main I made a button with a tell target
On rollover tell target blink to goto frame 2 and stop
On rollout tell target blink to goto frame 1 and stop
This works but is it right ???????

I would like to tell the blinking script to stop blinking on rollout and start blinking on rollover is there a way to do this. I no there is a way I'm just to DUMB Please help a Dumb Person. Here is the script it works it makes the circle blink.

onClipEvent (load) {
this._visible = true;
}
onClipEvent (enterFrame) {
if (this._visible == true) {
this._visible = false;
} else if (this._visible == false) {
this._visible = true;
}
}

Training From The Source - Flash MX Actionscript Advanced - Files
Hi all,
I have the above book (Macromedia - Training from the Source - Flash MX Actionscript Advanced) But I have now moved to Australia from the UK however have left the CD behind. I have been trying to find the source files anywhere on the web but have had no luck. Does anyone know where I can download them.
I would really appreciate any help in finding these files.

Thanks
Graham

Can Anyone Convert This Actionscript 2.0 Code To Actionscript 3.0 Code ?
Hi, I'm a graphic designer and I've used this system since the last two years. I would like to convert it on to actionscript 3.0 but I am not a programmer. Can someone help me please? Thank you!

on(rollOver){
txt.gotoAndPlay("entrada")
}
on(rollOut){
txt.gotoAndPlay("salida")
}

on (release) {
_parent.navegate("clip01")

if (_parent.anterior != "occitane") {
_parent[_parent.anterior].gotoAndPlay("salida");
}
_parent.anterior = "occitane";
_root.navigate("occitane");
}

================================================== ===

function navigate(destino) {
if (firstime != false) {
_root.currentSection = destino;
_root.gotoAndPlay("salida");
firstime = false;
} else {
_root.currentSection = destino;
_root.contenedor.gotoAndPlay("salida");
}
}

================================================== ===

salida = "salida00"
function navegate(destino){
this.destino=destino
this.gotoAndPlay(salida)
salida = "salida" + destino
//salida = "salida" add destino
}
stop()

================================================== ===

fscommand("showmenu", "false");
fscommand("allowscale", "false");

Stage.scaleMode = "noscale";
//-----------------------
var StageWidth:Number = 1000;
var StageHeight:Number = 546;
function escalaFondo()
{
if (Stage.width > Stage.height) {
fondo._width = Stage.width;
fondo._yscale = fondo._xscale;
} else {
fondo._height = Stage.height;
fondo._xscale = fondo._yscale;
}

fondo._x = (StageWidth - fondo._width) / 2;
fondo._y = (StageHeight - fondo._height) / 2;
}
//-----------------------
Stage.addListener(this);
this.onResize = escalaFondo;
escalaFondo();
//-----------------------

Advanced Flash ActionScript 2.0 Load Video/audio Control Question.
I am loading two external Flash SWF files into my present Flash movie. The first one that loads is a music player. The second movie I am loading upon the click of a button and it is a external SWF that contains a
Flash video.

Right now I am simply loading the video SWF movie into the same layer as the music player so that it will stop the playback of the music so the viewer can see the video AND hear it's audio. Please note: I am using the Flash CS3 built it component for FLVPlayBack. I have named the instance mainVideo.

Unfortunately when the video ends it just sits there on the last frame.

I would like to have suggestions as how to:
a.) Unload the SWF Flash video that has just completed playback and..
b.) resume the playback of the audio that was last playing.

I am loading the Flash SWF music with the following:
-------------------------------------------
on(release) {

loadMovieNum("/motion/flash/music/music2.swf",1);
_root.soundstatus="on";
_parent.equalizer.gotoAndStop(1);
_parent.gotoAndStop(1);
}
------------------------------------------
I am loading the external SWF Flash video with:
------------------------------------------
on(release) {

loadMovieNum("/motion/flash/video/kirklandPSA.swf",1);
_root.soundstatus="on";
_root.equalizer.gotoAndStop(1);
_parent.gotoAndStop(1);


}
-----------------------------------------------

Suggestions and help appreciated.

Thanks in advance,

Rip

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;
}




}

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