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








Actionscripting Help PLEASE


Good evening board!

I am playing around in Flash, and another Flash-like program called Swish. I am attempting to call a movie to play inside of a flash file, but while I got the movie to show, I need help adjusting the coordinates.

Does anyone know where I can go to adjust the coordinates and/or find out how it appears in the syntax. Thanks a lot all, and I look forward to posting more and learning more through you all.

-Courag




FlashKit > Flash Help > Flash MX
Posted on: 07-06-2004, 08:37 PM


View Complete Forum Thread with Replies

Sponsored Links:

A Bit Fo ActionScripting Help, Please
I just need a little help with generating or/and using random variables in Flash. I'm pretty comfortable with simple ActionScript commands, bt getting a random number baffles me.

The purpose it very simple actually, I've got 12 scenes in a movie and what I want to do is, at the start do some sort of function and get a random number between 1 and 12, eg. 6, then GoToandPlay scene 6, at the end of scene 6, it should jump back to the start and the repeat etc.....

Any help will be greatly appreciated, Cheers.

Gunzalez
http://www.gunzalez.co.uk.

View Replies !    View Related
If You Know ActionScripting Please Help...
Basically, here's what I have:

What I am trying to do is make a nav button that, on the roll over, starts an animation which moves the box to the right (or any side). I have that part done, no problem. I even learned how to put a Stop command after the last frame in the animation so it won't loop!

Here's where I could use some help please. What I would like to do is have it set up so when the mouse leaves the button (Don't know the correct term, sorry) it won't just instantly go back to its original postion. I would like it to go back slow, the same way I have the animation set up to move it to the right. Also, instead of the animation starting every time I rollover and then go back to the original position as soon as the mouse is off of it, even if it's in the middle of the animation, how can I make it perform the animation in whole, finish it first before just going back to the original spot?

Thanks a lot if you can teach me the scripting needed or actions needed to do this.

View Replies !    View Related
Is This Actionscripting?
Basically I am just trying to get my flash movie to open in a browser just like this company's flash version http://www.01-la.com/

Is this actionscript? If not, how do I get my html or flash website to open like this?

View Replies !    View Related
Help With 3d Actionscripting.
I was wondering if anyone can show me the light? I need to draw a 3d soccer ball. Then I have to take that 3d ball and make it rotate. It goes to how the mouse moves. It will start rotating and then if the user goes over the ball it will measure how fast they went over the ball and make it spin faster. Anyone know what I mean? Any help will be well worth it. Thank you very much and have a great day!
Chad R. Smith

-------www.designcmc.com--------
"We know we are not the 'Flashiest' site but we can hold our own"

View Replies !    View Related
Can Actionscripting Do This? Or....
can dreamweaver make search engines like this http://store.nba.com/

I have a client that will be selling athletic wear and wants a search engine also. if dreamweaver cannot do this, how can i create a search button that searches the entire website for keywords?

can actionscripting do this?

View Replies !    View Related
ActionScripting
Could Anyone Direct me to a website, or tell me them selves, how to use key mapping, to make a figure on screen, not only move, but move by actually moving their legs? Pretty much what i mean, how do you make a character actually walk forwards, by moving their legs, when you press a key?

D'oh, this is in Flash MX. Thanks.
[Edited by Xefov on 08-14-2002 at 03:24 AM]

View Replies !    View Related
Actionscripting And Mac's
I am having promblems with the flash movie on a site I'm doing. The .swf works fine on PC's but it's not on the Mac. Are there some actionscripting issues with Mac and Pc platforms.

Here's the scripts

Frame One:

oldx = 0;
newx = 0;
x = 0;

Frame two:

x = getProperty('/dragMC/buttonMC',_x);
newx = oldx + (x - oldx)/8;

setproperty('/scrolledMCrecipient/scrolledMC',_x,newx);
oldx = newx;

play();

Frame three:

prevFrame();

Script on button:

on ( press ){
startDrag('',false,-1478,0,0,0);
}

on ( release, releaseOutside ){
stopDrag();
}

THanks

View Replies !    View Related
Help Please...(actionscripting Again)
hey its me again..still banging my head trying to do me animation..lol


does anyone kno how you can define the distance from the centre of a movieclip... and also..once you have chosen the distance, you can tell it to play a movie with a hit test method.

thanx

View Replies !    View Related
Actionscripting...
i have a mc inside several other mc:s, all with different instance names. what i want to do is that when the mc named "s2" has the x-position (relative to the stage), the mc "page2" will go to frame 2.

if (_root.art.content.pages.page2.s2._x == 303) {
_root.art.content.pages.page2.gotoAndPlay(2);
} else {
_root.art.content.pages.page2.gotoAndPlay(1);
}

any ideas? thanks

View Replies !    View Related
If And Else Actionscripting
My Actionscript:

on (release)
{if
(txtname ne "" and txtemail ne "" and txtphone ne "" and txtaddy ne "" and txtstate ne "" and txtzip ne "");
getURL("mailto:service@boydbrothersservice.com");
gotoAndPlay("valid");
} else {gotoAndPlay(invalid)}


And Error Message:

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 5: 'else' encountered without matching 'if'
} else {gotoAndPlay(invalid)}


help?

View Replies !    View Related
Actionscripting
K. how would you load a swf file into your web site without it going to a new seen.

View Replies !    View Related
Actionscripting
How do you make a volume controle. for a web site.

View Replies !    View Related
? Regarding Mx Actionscripting...
I'm a noob at actionscripting...simple as that. But i want to learn! so anyways... my ? Basically i just want my movie clip to play w/ mouseover and to stop w/ mouseout (i dont know the correct terminology yet...) I realize its prob the easiest thing to do ... but i need this to move on w/ my project.

View Replies !    View Related
Actionscripting
is it possible to make a loading bar that fades out into the next seen.

View Replies !    View Related
Help With Mc Actionscripting
i'm building a flash presentation. i want it to run similar to a ppt presentation, where the user presses the space bar and it advances to the next label, frame, whatever. i have my different sections ("slides") in movie clips on the main timeline.

i was using an "on clip event" goto and play label1, label2, etc. but i'm not sure how to handle it at the end of that movie clip, how can i get it to jump to the next one?

can anyone help?

View Replies !    View Related
Actionscripting
Where do you put the actionscripting in the flash.I xouldnt find it.PLease help

View Replies !    View Related
ActionScripting
How to dynamically define the size on any object. For eg., how to define the radius of a circle?

View Replies !    View Related
Actionscripting
Hello. i would like to know how to make a button like the ones that Joshua Davis has on his sit. Where you clik on it it stay a diffrent color and then it shows you whic ones you have allredy visited wich are in a difrent color.


thanks in advance.

View Replies !    View Related
Actionscripting
I have multiple movies on my main timeline that are controlled by tell targets. I would like to not have to tween certain objects in my movie clips. When a main frame on my movie loads how can I load a mc and move it with action script? How do you make a mc follow a path with actionscript? How do I control the timing of this movement with actionscripting?
Thanks.

View Replies !    View Related
Need Some Help With Actionscripting
I am trying to turn http://www.flashkit.com/movies/Anima...-402/index.php into a banner so it would work just like that but i would be able to put my pics in it. I have done everything except the actionscripting , and that seems to be the prob , if someone could be of some assistants that would be good

this is what i ended up with

www.dopetimbs.com/banner attempt2.fla

thanks a lot

View Replies !    View Related
Cd-rom Actionscripting
Hey Everyone,

I'm about to start designing a cd-rom flash movie for a band i've got a job for but I'm not sure on a bit of actionscripting, I'm just wondering if there is a block of actionscript or a parameter that makes a flash movie launch in full-screen mode automatically? (i'm going to launch the movie from an autorun.inf file)

Also I was just wondering if there is a piece of code that can close the movie/window on call of an event?

Thanks,

View Replies !    View Related
Actionscripting
Hi,

I wanted to know what actionscript would I use to play the prevframe of a movieclip once I roll out. Here is the code that I use for the roll over:


onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
tellTarget (guest) {
play();
}
}
}

so its like unloading the movieclip once I roll out.
Thanks

View Replies !    View Related
I'm New To Actionscripting, Need Some Help
Yes, i recent bought the macromedia book thats supposed to teach actionscripting. I find most of it very confusing and i'd like to ask some questions. Im using Macromedia Flash MX... so if anyone would like to help me or answer some questions i may have as i slowly slowly work my way through this book please email me. Hwap462@hotmail.com thank you
Andy

View Replies !    View Related
Actionscripting
hello I bought the book flash mx 2004 H.O.T and i thought it was great..I actually learned and understand(still learning) symbols, tweening, buttons, masking, text and basic interacting (action scripting)

teh problem is that the book does not go into anymore detail about action script...i tried to follow the help guide from macromedia but its hard for me to amke sense of it..

my question is that i want to know what books do you recommend for action scripting...and also on a side note how long did it take you guys to become good in flash??

thanks in advance

View Replies !    View Related
Too Much Actionscripting? Maybe?
help me! PLEASE!
i made this neat navigation using different tutorials from you guys and it was working till i put in the leaves, you'll see, now my buttons to link to the different parts of my html site dont work, ill post both the .fla and .swf file...thanks!

.swf link
.fla link

oh yeah i put it up to see how it looks on my site so if you want you can see more of what im talking about artistic[dash]ambience

View Replies !    View Related
Actionscripting Help
Okay... I'm lost right now. My question is like with a simple code like.
my_income=75;
my_expenses=30;
my_savings=my_income-my_expenses;

I want people to be able to punch in there income in a little text box and then punch in the expenses and then press a button and have it calculate it, but I just don't know how. Can anyone tell me how to do it, and explain like I was a 10 year old?

View Replies !    View Related
I Need Actionscripting Help
I have a movie clip and I want it to got to frame 29 when I roll over it so I did this

on (press, release, releaseOutside, rollOver, rollOut, dragOver, dragOut) {
gotoAndStop(29);
}

I did that on the movie clip. The problem is that when I roullover it It goes to the movie clips 29th frame and not the actual scene.

View Replies !    View Related
PHp Actionscripting
Here is what I'm trying to do I'm trying to use a flash to send variables to a php script.

My problem is that it isn't working ITs simply supposed to e-mail me with the information that is put into the input text boxes.

HEre is the PHP:
<?;
$name= $_POST[name];
$phone= $_POST[phone];
$email= $_POST[email];
$street= $_POST[street];
$city= $_POST[city];
$state= $_POST[state];
$church= $_POST[church];
$time= $_POST[time];
$ToEmail = "timh@championsclub.org";
$ToName = "Timothy Henley";
$ToSubject = "Christmas Party Volunteer Application";
$EmailBody = "Name: $name
Phone: $phone
E-mail $email
Address:
$street

$city
state
Church: $church
Best time to be reached: $time";
$EmailFooter="
This message was sent by: $FirstName from $REMOTE_ADDR If you
feel that you
recieved this e-mail by accident please contact us at www.championsclub.org.com";
$Message = $EmailBody.$EmailFooter;
mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$Name." <".$Email.">");
Print "_root.info.substatus=Complete - Your submission has been sent"; ?>

ANd here is the Actionscript:

on (release) {
if (!name.length){
substatus = "Please enter your name before sending";
}
else if (!phone.length) {
substatus = "Please enter a valid phone number";
}
else if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
substatus = "Please enter a valid E-mail address";
}
else if (!street.length) {
substatus = "Please enter a street";
}
else if (!city.length){
substatus = "Please enter a city";
}
else if (!state.length){
substatus = "Please enter a state";
}
else if (!church.length){
substatus = "Please enter a church";
}
else if (!time.length){
substatus = "Please enter a time in which you may be reached.";
}
else {
loadVariablesNum ("submission.php", "0", "Post");
substatus = "One moment submitting registration.";
}
}

Any clue on what is worng in the scripting?

Here is the url of the .swf. http://www.championsclub.org/getinvolved/christmas/

View Replies !    View Related
Actionscripting
OK,I've got a main page,(swf), and a secondary page with a "home" button on it. I can write the script to get it back to the home page, but, I want it to go to not frame 1 but frame 500 where I have put a label of "home" on the original swf. I have tried every kind of action scripting I can think of. I use loadmovie, and that's fine but it starts at frame1. I tried a second line added to that of gotoandplay("home") and it still starts at frame 1. Please help me as I have spent about 8 hours on this so far and getting nowhere!!!

View Replies !    View Related
Is This Done By Actionscripting?
can anybody tell me how this is done?
http://www.dcpulsemag.com/portal/lookbook/issue01.swf

View Replies !    View Related
Cd-rom Actionscripting Help
hello...

I'm making a promotional cd-rom for the leisure centre where I work. I am using flash as the main part of the interface, but would like my flash movie to fill the screen, depending on how big the viewer's screen resolution is set at...

I have no idea what the actual code would be for this...I'm not new to action script, but have just not had to / wanted to make a full screen flash movie before...

Also, does anyone have any tips / hints on making a cd-rom like this...?

many thanks...

View Replies !    View Related
Actionscripting...
Hello,

I intend to have an animation with balls moving around which leave paths of fire burning away in the balls' pathway.

So how should I do this best?

Oh, and I use Flash MX.

Kaerwek

View Replies !    View Related
Actionscripting Help
When I copy and paste the code from the tutorials such as the snow tutorial, it never works. I always get an error output message that states "...unexpected } ..(something to that nature). What is it that I need to know to fix this error and how do you know what to fix?

View Replies !    View Related
Actionscripting Help
Here is my link...
http://webspace.westwood.edu/daniellerussell/index.html

The file that need to be looked at is banana republic nav/potatohead

With the potatohead file, I was supposed to make the buttons to a specific action. For instance, make the model have green eyes with red lipstick. Here in my work, it did not work out that way. I need to know how to make the buttons stop on a specific action and how to make the movie clips work accordingly.

View Replies !    View Related
ActionScripting HELP
Ok so if I have a MC called guy and a MC called shop, I can use Keyboard to navigate guy and this is what I am trying to do #

If guy is hit-testing shop, I want a dynamic Txtbox to say: - Press Space to Acess Shop - Better get your wallet first! -
And If I press SPACE while guy is hit-testing shop, I want to gotoAndStop to another location.

This is the AS i dreamed up:


Code:
onClipEvent (load) {
if (this.hitTest(_root.guy)) {
description = "Shop Keeper, Its best if you have some money on you though";
if (Key.isDown(Key.SPACE)) {
_parent.gotoAndStop("eleswhere",1);
}
}
}


So could anyone tell me what's wrong and how do i fix it?

View Replies !    View Related
Actionscripting A FLV
I need to return to the main menu when a FLV is finished. What code do I use to find out the movie is done and where does it need to be placed? In the menu there is a selection of FLV files that can be played. Where is the best place to attach the FLV controls? Should I put them in the menu itself or pass a variable to the controls? Thank you.

View Replies !    View Related
Actionscripting Help
Hi all,
I'm a newbie to flash, and a newbie to this site.
I was wondering if anyone knows how to use flash actionscripting to get the flash player to move to one frame to another, without it having to be in a movie clip?
What actionscripting would you use to make it work?
If anyone can help me out, i'd really appreciate it.
Thanxs

View Replies !    View Related
Actionscripting Help
ummm, im pretty much in a bind here on trying to figure out something with the full browser, and how to do a gallery similar to this...

http://moma.org/exhibitions/2007/jeffwall/

so if anyone could help me out it would be much much ablidged...thank you.

View Replies !    View Related
Actionscripting (Ugh).
Can anyone tell me why this isn't working? I'm learning actionscript and my first lesson isn't working. I made a movie clip with the instant name 'mcQuit'.

mcQuit.onPress = function():Void {
trace("Why isn't this working?")
};

In this case the lessons from Lynda.com are created from MX and I'm using 8, is there an actionscript conflict here?

View Replies !    View Related
New To Actionscripting
Hi guys,

I have been using flash mainly for animation to past 5 years, however I have never really delved into the the actionscripting side of things.

I am currently working on bettering skills bit by bit and wondered if anyone could guide me in the right direction. I am currently using Flash pro CS3 but am used to basic AS2. Is it better to learn AS3 or stick with what I am used to.

Also I would like to pass a scenario by you guys and possibly get some direction on this too.

I am creating a flash movie that will load in various weather animated movie clips i.e. heavy rain, sunshine, etc... This will be based on some conditions I have from an RSS/XML weather feed which is currently setting some variables (that bit works). However I do not know how to load in the movie clips that I have made depending on the value of the variables.

I hope all of this makes sence, please correct me if i am wrong.

Regards

Damon

View Replies !    View Related
[F8] Actionscripting Help
Hello, I have created an .fla whit actionscripting (script is not my, it is from tutorial) anyway every thing was fine until I the last one.

Save the file and open it then test movie. Move your mouse on first images (on some hat or jackets) and you should get a toolbar on the image where shows information. Now try to move your mouse on the lastest ones clothes, now the information shows under the image. Why is it? I was checking the action script and I was doing everything like whit the first ones images.

Please help me.

View Replies !    View Related
Help W/ Php And Actionscripting
EXAMPLE URL:
http://dev.etkinllc.com.gamma.reol.n...hp?propid=1119

WHAT IS SUPPOSED TO HAPPEN:
when you click on the thumbnails of the "MORE PHOTOS", it'll open up the full image in replacement with the image shown in the flash movie.

ELEMENTS:
$propid < (property ID)

THE ACTIONSCRIPT:

Code:
accel=1;
stop();
Stage.showMenu=false;

if (img==1){
loadMovie("img_property/"+propid+"-1.jpg", _root.loadme);
}
else if (img==2) {
loadMovie("img_property/"+propid+"-2.jpg", _root.loadme);
}
else if (img==3) {
loadMovie("img_property/"+propid+"-3.jpg", _root.loadme);
}
else if (img==4) {
loadMovie("img_property/"+propid+"-4.jpg", _root.loadme);
}
else if (img==5) {
loadMovie("img_property/"+propid+"-5.jpg", _root.loadme);
}
else gotoAndPlay(2);
THE FLASH TAG IN THE PHP PAGE:

Code:
<?
$results = pgdbsql ("SELECT * FROM properties WHERE propid ='$propid'", "etkin");
$propid = $_GET['propid'];
if (!isset($img)){
$img='0';
} else {
$img=$_REQUEST['img'];
// echo 'img =' . $img;
}
if (file_exists('img_property/'.$propid.'.swf')) { ?>
<object class="main_img" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="423" height="266" id="<?= $propid ?>" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="img_property/<?= $propid ?>.swf?propid=<?= $propid ?>&img=<?= $img ?>" />
<param name="quality" value="high" />
<param name="bgcolor" value="#FFFFFF" />
<embed src="img_property/<?= $propid ?>.swf?propid=<?= $propid ?>&img=<?= $img ?>" quality="high" bgcolor="#FFFFFF" width="423" height="266" name="<?= $name ?>" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<? } elseif (file_exists('img_property/main_'.$propid.'.jpg')) { ?>
<img src="img_property/main_<?= $propid ?>.jpg" border=0>
<? } else { ?>
<img src="img_property/property_na.gif" border=0>
<? } ?>
... SO WHAT HAPPENS IS, THE PHOTO DOES NOT update, and all i get is the black bg.

would love to have some assistance on it!

Thanks.
-ps

View Replies !    View Related
Help With Actionscripting
Hello peoples of the world,
i am a experinced animator in flash, and have just discoverd the wonderfull world of Actionscripting.


i am trying 2 create a game for my friend, it is very simple. you are a giant Ape, and u can walk around, and punch stuff ( he likes King Kong ) any way...

i have the animations for the Ape: walking, still, and punching

But i dont think my action scripts are very good, its close but not good enough.

my code so far is :

onClipEvent(enterFrame)
{

//codes for actions
if(Key.isDown(Key.RIGHT)){
gotoAndStop(2)
_x+=8;
_xscale=+85; //walk frame
}


//codes for actions
if(Key.isDown(Key.LEFT)){
gotoAndStop(2)
_x-=8;
_xscale=-85; //walk frame
}


//codes for actions
if(Key.isDown(Key.SPACE)){
gotoAndStop(3) //punch frame
}

else gotoAndStop(1);
}


The problem is, he will "punch" and move left and right, but the "walking" animation doesn't play.

and if i put the punch script at the top the walking animation plays, but the punch doesn't

thanks for any help, ( i use a macintosh computor, if it makes any differnce )

View Replies !    View Related
ActionScripting Help
Hi Buddies
i m developing an application which is getting data from a text file and then display it in flash movie, but the problem is this that it display the last last values.i want to display all data. plz help me i hav attached my files.
Thanks

View Replies !    View Related
Need With Help With ActionScripting
I have an assignment for a class. This is what the assignment calls for:

Extend the functionality of the Mix Box audio example from chapter 7
to include the following features:

-Add a scratch box to the mixer that will make a scratching sound as long as the mouse is over the box and the mouse is moving.
-If the mouse is not over the box, no scratching sound should be played
-If the mouse is not moving, no scratching sound should be played


I can get the sound to play, but only on a complete rollOver (ie the sound plays when the mouse goes on the box and off it).

here's my code, Any help is most apprieciated as the assignment is due in 4 hours (12:00 AM EST)


Quote:




onClipEvent (mouseMove) {
var mouseOn:Boolean = false;
scratchloop = new Sound();
scratchloop.attachSound("scratchSound");
scratchPad.onRollOver{
mouseOn = true;
watchMouse = new Object();
watchMouse.onMouseMove = function () {
if (mouseOn == true && this.hitTest(this._xmouse, this._ymouse, true)) {
scratchSound.start();
}
else if (mouseOn == false && this.hitTest(this._xmouse, this._ymouse, false)) {
scratchSound.stop();
}
};
Mouse.addListener(watchMouse);
}
}

View Replies !    View Related
PLEASE HELP IN ACTIONSCRIPTING..
PLEASE HELP...! im working a flash site that has a dropdown menu and submenus on it using external xml files..it works fine but my problem is..what if the submenus will be consist of 50 buttons or more..?! ..that means it needs a mask and a scrollbar...how can i do that...? ...please i really need an answer...please email me.. rayram76@yahoo.com







Attach Code

// generates a list of menu items (effectively one menu)
// given the inputted parameters. This makes the main menu
// as well as any of the submenus
GenerateMenu = function (container, name, x, y, depth, node_xml) {
// variable declarations
var curr_node;
var curr_item;
var curr_menu = container.createEmptyMovieClip(name, depth);
// for all items or XML nodes (items and menus)
// within this node_xml passed for this menu
for (var i = 0; i<node_xml.childNodes.length; i++) {
// movieclip for each menu item
curr_item = curr_menu.attachMovie("menuitem", "item"+i+"_mc", i);
curr_item._x = x;
curr_item._y = y+i*curr_item._height;
curr_item.trackAsMenu = true;
// item properties assigned from XML
curr_node = node_xml.childNodes[i];
curr_item.action = curr_node.attributes.action;
curr_item.variables = curr_node.attributes.variables;
curr_item.name.text = curr_node.attributes.name;
// item submenu behavior for rollover event
if (node_xml.childNodes[i].nodeName == "menu") {
// open a submenu
curr_item.node_xml = curr_node;
curr_item.onRollOver = curr_item.onDragOver=function () {
var x = this._x+this._width-5;
var y = this._y+5;
GenerateMenu(curr_menu, "submenu_mc", x, y, 1000, this.node_xml);
// show a hover color
var col = new Color(this.background);
col.setRGB(0xFFFFCC);
};
} else {
// nodeName == "item"
curr_item.arrow._visible = false;
// close existing submenu
curr_item.onRollOver = curr_item.onDragOver=function () {
curr_menu.submenu_mc.removeMovieClip();
// show a hover color
var col = new Color(this.background);
col.setRGB(0xFFFFCC);
};
}
curr_item.onRollOut = curr_item.onDragOut=function () {
// restore color
var col = new Color(this.background);
col.setTransform({ra:100, rb:0, ga:100, gb:0, ba:100, bb:0});
};
// any item, menu opening or not can have actions
curr_item.onRelease = function() {
Actions[this.action](this.variables);
CloseSubmenus();
};
}
// end for loop
};
// create the main menu, this will be constantly visible
CreateMainMenu = function (x, y, depth, menu_xml) {
// generate a menu list
GenerateMenu(this, "mainmenu_mc", x=4, y=-10, depth, menu_xml.firstChild);
// close only submenus if visible durring a mouseup
// this main menu (mainmenu_mc) will remain
mainmenu_mc.onMouseUp = function() {
if (mainmenu_mc.submenu_mc && !mainmenu_mc.hitTest(_root._xmouse, _root._ymouse, true)) {
CloseSubmenus();
}
};
};
// closes all submenus by removing the submenu_mc
// in the main menu (if it exists)
CloseSubmenus = function () {
mainmenu_mc.submenu_mc.removeMovieClip();
};
// This actions object handles methods for actions
// defined by the XML called when a menu item is pressed
Actions = Object();
Actions.goto = function(frameVar) {
gotoAndStop(frameVar);
};
Actions.gotoURL = function(urlVar) {
getURL(urlVar, "_blank");
};
Actions.loadFile = function(url) {
loadMovie(url, "empty");
};
Actions.message = function(msg) {
message_txt.text = msg;
};
Actions.newMenu = function(menuxml) {
menu_xml.load(menuxml);
};
// load XML, when done, run CreateMainMenu to interpret it
menu_xml = new XML();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function(ok) {
// create main menu after successful loading of XML
if (ok) {
CreateMainMenu(10, 10, 0, this);
message_txt.text = "message area";
} else {
message_txt.text = "error: XML not successfully loaded";
}
};
// load first XML menu
menu_xml.load("data/countries/menu1.xml");

























Edited: 01/12/2007 at 10:36:32 AM by Ldavinci

View Replies !    View Related
ActionScripting
check out my website @ www.ugotrice.com

the dynamic text i have in the middle, variable is called "showtext"
the top i have buttons
i want to do something like on (release) { } and it would get the info to show in the dynamic text from text files
current textfiles are
~info.txt
~matches.txt
~news.txt
~roster.txt
~servers.txt
~sponsors.txt

Ive tried and it didnt work

on (release) {
var showtext:LoadVars = new LoadVars();
showText.load("news.txt");

showText.onLoad = function() {
showtext.text = this.text;
}
}

View Replies !    View Related
New At ActionScripting
I'm new at actionscripting althought not new to flash. I tried creating the photo gallery using the code that is posted here on kirupa @(http://www.kirupa.com/developer/mx/photogallery.htm)
but it doesn't seem to load. I"ve been using Flash 5, (I'm more comfortable using 5) and I don't know if it makes a difference. But I also tried it on MX and it didnt' seem to load with MX either. I don't know if I'm messing up on the dir for the images or what have you, but most of the time I get nothing when I preview it, other times my image frames pops up for a split second.

here's what I've what i've done


ActionScript Code:
// Code written by sbeener (suprabeener)// // i wrote this code, but you can use and abuse it however you like.// the methods are defined in the order which they occur to make it// easier to understand.// // variables ------------------------------------------// put the path to your pics here, include the slashes (ie. "pics/")// leave it blank if they're in the same directorythis.pathToPics = "product/";// fill this array with your picsthis.pArray = ["bau.jpg", "canz.jpg", "clocks1.jpg", "clocks2.jpg", "FORKS.jpg", "keyfinal.jpg", "pigs.jpg", "reflection2.jpg", "shine.jpg", "space1.jpg", "triangle.jpg"];this.fadeSpeed = 20;this.pIndex = 0;// MovieClip methods ----------------------------------// d=direction; should 1 or -1 but can be any number// loads an image automatically when you run animationloadMovie (this.pathToPics+this.pArray[0], _root.photo);MovieClip.prototype.changePhoto = function (d) { this.pIndex = (this.pIndex+d)%this.pArray.length;if (this.pIndex<0) {this.pIndex += this.pArray.length;}this.onEnterFrame = fadeOut;};MovieClip.prototype.fadeOut = function () { if (this.photo._alpha>this.fadeSpeed) {this.photo._alpha -= this.fadeSpeed;} else {this.loadPhoto();}};MovieClip.prototype.loadPhoto = function () { var p = _root.photo;p._alpha = 0;p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);this.onEnterFrame = loadMeter;};MovieClip.prototype.loadMeter = function () { var i, l, t;l = this.photo.getBytesLoaded();t = this.photo.getBytesTotal();if (t>0 && t == l) {this.onEnterFrame = fadeIn;} else {trace (l/t);}};MovieClip.prototype.fadeIn = function () { if (this.photo._alpha<100-this.fadeSpeed) {this.photo._alpha += this.fadeSpeed;} else {this.photo._alpha = 100;this.onEnterFrame = null;}};// Actions -----------------------------------------// these aren't necessary, just an example implementationthis.onKeyDown = function () { if (Key.getCode() == Key.LEFT) {this.changePhoto(-1);} else if (Key.getCode() == Key.RIGHT) {this.changePhoto(1);}};Key.addListener(this);



any ideas?
thanks

View Replies !    View Related
Actionscripting
Hi can u help me by telling me how to enter actionscript I'm really stuck thanks Stu

View Replies !    View Related
Actionscripting
in my c++ class, we are working with if/then/else statements and was wondering what , if any similarity does the c++ format have with actionscript?
if no similarity, please post the proper way to make an if/then/else statement, for example, in c++ it would look somehwt like...


Code:
if(variable1=random)
cout<<"Variable One is equal to the random number.";
else
cout<<"Variable One is not equal to the random number.";
also how does actionscript handle algebraic equations.
any help is very appreciated

View Replies !    View Related
New At ActionScripting
I'm new at actionscripting althought not new to flash. I tried creating the photo gallery using the code that is posted here on kirupa @(http://www.kirupa.com/developer/mx/photogallery.htm)
but it doesn't seem to load. I"ve been using Flash 5, (I'm more comfortable using 5) and I don't know if it makes a difference. But I also tried it on MX and it didnt' seem to load with MX either. I don't know if I'm messing up on the dir for the images or what have you, but most of the time I get nothing when I preview it, other times my image frames pops up for a split second.

here's what I've what i've done


ActionScript Code:
// Code written by sbeener (suprabeener)// // i wrote this code, but you can use and abuse it however you like.// the methods are defined in the order which they occur to make it// easier to understand.// // variables ------------------------------------------// put the path to your pics here, include the slashes (ie. "pics/")// leave it blank if they're in the same directorythis.pathToPics = "product/";// fill this array with your picsthis.pArray = ["bau.jpg", "canz.jpg", "clocks1.jpg", "clocks2.jpg", "FORKS.jpg", "keyfinal.jpg", "pigs.jpg", "reflection2.jpg", "shine.jpg", "space1.jpg", "triangle.jpg"];this.fadeSpeed = 20;this.pIndex = 0;// MovieClip methods ----------------------------------// d=direction; should 1 or -1 but can be any number// loads an image automatically when you run animationloadMovie (this.pathToPics+this.pArray[0], _root.photo);MovieClip.prototype.changePhoto = function (d) { this.pIndex = (this.pIndex+d)%this.pArray.length;if (this.pIndex<0) {this.pIndex += this.pArray.length;}this.onEnterFrame = fadeOut;};MovieClip.prototype.fadeOut = function () { if (this.photo._alpha>this.fadeSpeed) {this.photo._alpha -= this.fadeSpeed;} else {this.loadPhoto();}};MovieClip.prototype.loadPhoto = function () { var p = _root.photo;p._alpha = 0;p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);this.onEnterFrame = loadMeter;};MovieClip.prototype.loadMeter = function () { var i, l, t;l = this.photo.getBytesLoaded();t = this.photo.getBytesTotal();if (t>0 && t == l) {this.onEnterFrame = fadeIn;} else {trace (l/t);}};MovieClip.prototype.fadeIn = function () { if (this.photo._alpha<100-this.fadeSpeed) {this.photo._alpha += this.fadeSpeed;} else {this.photo._alpha = 100;this.onEnterFrame = null;}};// Actions -----------------------------------------// these aren't necessary, just an example implementationthis.onKeyDown = function () { if (Key.getCode() == Key.LEFT) {this.changePhoto(-1);} else if (Key.getCode() == Key.RIGHT) {this.changePhoto(1);}};Key.addListener(this);



any ideas?
thanks

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