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




[FMX04] Automating Color Object Variables For Multi-level Game



Hi, I'm trying to create a simple multi-level game with actionscript 2 (MX2004).In the game I have many box movie-clips which must be moved by the player to "Home" positions, when they are over a Home they change colour.I have achieved the colour change with setTransform (not setRGB as I want transparency in order that the boxes retain their detail)This is a snippet of the code for a level with 4 boxes in it:var numBoxes:Number = 4;var box_color1:Color = new Color(box1);var box_color2:Color = new Color(box2);var box_color3:Color = new Color(box3);var box_color4:Color = new Color(box4);// Set the values for myColorTransformvar BlueT:Object = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:250, aa:100, ab:70};var OriginalT:Object = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:255}; //Check whether over any 'HOME' and then set Home colourfor(i=1; i<=numBoxes; i++){ if (this["BoxHome" + i].hitTest(this["box" + t])) // 't' is the box we're pushing{this["box_color" +t].setTransform(BlueT); home_array[t] = 1; break;}else {this["box_color" +t].setTransform(OriginalT); home_array[t] = 0;}}So the Boxes start off one colour (green) and when they are pushed over a "Home" area they change to a blue colour.This ALL works well - don't know if it is the most efficient approach.My problem is each game levels has differing numbers of boxes, so for a level with 32 boxes I would have to have 32 lines of var box_color1:Color = new Color(box1);var box_color2:Color = new Color(box2);...var box_color32:Color = new Color(box32); I have two problems with this - obviously it is inefficient, but more importantly I cannot,with this method, use the same code for all levels, with merely a change of numBoxes (the number of boxes on the level).I was hoping to do something like:var numBoxes:Number = 32;for(i=1;i<=numBoxes;i++){var ["box_color" + i]:Color = new Color(boxi);}Which doesn't work - the Left Hand Side is faulty.I've googled endlessly for days without success, I hope you can help.



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 02-20-2008, 06:51 AM


View Complete Forum Thread with Replies

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

Making A Multi Level Game Help
ok i need help with making multiple levels. i want to make it kind of like mario for NES... like when mario presses up in a doorway and goes to a new level. But, the problem is that i dont know how to do that. so if you could please help me it would be greatly appreciated....

~Fl4sh Newbie~

How To Make A Multi-Level Game In Flash 5
I'm wanting to know, "How to Make a Multi-Level game with Flash 5"? EX: If I were to make a space game, where after reaching a score of 2000 points, the game pauses and displays the text "Stage 2", then continues or provides a button to make the game continue starting on stage 2. Any help with this question is grately appreciated.

coolburn

How To Make A Multi-Level Game Using Flash 5?
I'm wanting to know, "How to Make a Multi-Level game with Flash 5"? EX: If I were to make a space game, where after reaching a score of 2000 points, the game pauses and displays the text "Stage 2", then continues or provides a button to make the game continue starting on stage 2. Any help with this question is grately appreciated.

coolburn

[CS3] Multi Level Drop-down Menu. Trouble With The Multi Level Bit
Hi,

I'm creating a multi-level drop down menu for a college project. So far I have 2 main menu items, one of which (products) contains 3 sub menus (line 1, 2 and 3). Line 1 should also have 3 sub menu items (product 1, 2 and 3).

I'm putting the actions for the line1_mc roll over and roll out on the main timeline but it doesn't seem to be working because it is trying to call a movie clip from within another movie clip!

Any ideas would be greatly appreciated!

Strange Problems.. Multi Level Variables Won't Work Proparly
Hi,

I'm having a very strange problem with this actionscript I made..

There is a main movie (level0) which loads a preloader (level100). This preloader then preloads 54 other swf files at level201 to 254. All of these swf files will send a variable to the main movie, telling they are fully loaded. And telling the preloader that the preloader can continue with preloading the next movie. This all seems to go ok, except for some variables that i just can't seem to be able to read!

The code:

the main movie comes in a "if frame is loaded" loop, to load itself. Then when it is finished, it will initialize some variables, and load the preloader:


Code:
Load Movie ("preloader.swf", 100)
Set Variable: "clicked" = "none"
(more variables are set, but clicked is needed for this explanation)

Then the preloader gets into a "if frame is loaded" loop. When the preloader is done, it will go to a scene, with a movieclip in it called preloader (so that would make it _level100/preloader) In this movieclip there are 54 frames, all with this piece of code:


Code:
Set Variable: "/:preloadId" = _currentframe
Call ("preloadFunction")
the piece of code it calls for in the call statement is:


Code:
If (Get("_level0:loaded"&/:preloadId) <> true)
If (Get("_level0:clicked") = Get("/:preloadId"))
Begin Tell Target ("_level0/preloaderStates")
Go to and Stop (2)
End Tell Target
End If
Load Movie ("photo_files/photo"&/:preloadId&".swf", Get("_level0:photoStartLevel") + Get("/:preloadId"))
Trace (Get("_level0:photoStartLevel") + Get("/:preloadId"))
Stop
Else
If (Get("_level0:clicked") = Get("/:preloadId"))
If (Get("_level0:clicked") <> Get("_level0:clickedPrevious") AND Get("_level0:clickedPrevious") ne "none")
Begin Tell Target ("_level"&(Get("_level0:photoStartLevel")+Get("_level0:clickedPrevious")))
Play
End Tell Target
End If
Begin Tell Target ("_level"&(Get("photoStartLevel")+Get("/:preloadId")))
Go to and Play ("photo")
End Tell Target
End If
Go to Next Frame
End If

all the files it has to preload are in the folder photo_files. The preloader seems to work properly.. it loads all the 54 files. Each of these files have a piece of code, similar to this (only the itemId variable changes):


Code:
If Frame Is Loaded (last frame, "lastframe")
Set Variable: "itemId" = 1
Set Variable: "_level0:loaded"&itemId = True
Begin Tell Target ("_level100/preloader")
Go to Next Frame
End Tell Target
Go to and Play (photo, "photo")
End Frame Loaded
Okay, now here is the problem.. I can't read all the variables from the main timeline!
When i trace some of the variables, some of them work just fine.. and some of them just don't appear!
for example:


Code:
Trace (Get("_level0/:clicked"))
will give the word "none" (which i set clicked at, in the init) and:


Code:
Trace (Get("_level0/:loaded"&/:preloadId) )
won't give any value!

if i run the movie in flash, and use CTRL+V to check on the variables, then i see this:


Code:
Layer #0:
Variable _level0:clicked = "none"
Variable _level0:loaded1 = "1"
Layer #100:
Variable _level100:preloadId = "1"
so.. what am i doing wrong?

damn this is one long post :)

Thanks in advance!

Multi-level?
I'm creating something similar to this (re-size, bounce and colour change) and am just wondering if it would be constructed using levels or not?
Any ideas

www.braingiants.com

Thanks

Multi-level Rollovers?
I've created three buttons running horizontally across the top of a page.

On RollOver each button displays three more "sub-buttons" underneath it. Each of the sub-buttons appear in the same area, with the main buttons visible at all times.

At the moment, each of the sub-buttons are .swf files that I load into the area, by adding a loadmovie function to the main buttons.

To achieve a roll-over effect I've also added unloadmovie to each main button, so that for example MainButton1 loads SubButtons1, and unloads SubButtons2 and SubButtons3, and so on for each button.

This is simple coding, but I'm sure there is a more effective way of doing this, especially without referring to external swf files.

Any help or tutorials?

Multi-level Instability
I have a set of Flash movies that dynamically load up several different movies into the 4 levels directly above the Main Engine of the whole application.

The Main engine is served from one web server, while the remaining modular Flash files that is uses are beased on a different server.

Although I have no problems loading the entire application up, it is sometimes very slow, and sometimes the application does not work properly.

HAS ANYONE FOUND THAT MULTI-LEVEL COMPLEX MOVIES HAVE PROBLEMS WITH

-LOADING SWF FILES FROM DIFFERENT SOURCES
-XML TRANSACTIONS NOT WORKING PROPERLY OR AT ALL
-DOWNLOADS COMING TO A GRINDING HALT

Multi-level Menu
Hi.

I'm doing a site redesign, and this time I'm doing it in Flash. I know the basics, and know some very basic ActionScripting.

I want to create a multi-level menu. IE, the buttons come in, user click on one, and that menu goes away. Then a new menu comes in, in place of the old one.

So far, I have the main menu, which goes away when I click on it. However, my scripting is not up to scratch, and at that point, it goes awry.

Any help would be appreciated.

Multi-level Communication
I have a movie running on my main timeline (_root) that loads a SWF on _level10. This SWF, in turn, loads another SWF on _level12.

Now, the _level12 SWF is a basic quiz with some drag and drop interactivity. When I created the _level12 movie it all worked like a champ - I did however use _root for scripting to test it as a standalone. I have 3 draggable buttons (a121, c121, & d121) with the following script:


on (press) {
startDrag (_root.a121, false, 135, 135, 430, 375);
}
on (release) {
stopDrag ();
if (this._droptarget == "/targeta") {
_root.dropCorrect ++;
}
}

and 2 draggable buttons (b121 & e121) with this:

on (press) {
startDrag (_root.b121, false, 135, 135, 430, 375);
}
on (release) {
stopDrag ();
if (this._droptarget == "/targeta") {
_root.dropCorrect --;
}
}

The user then selects the 'Check Answer' button that reads:

on (release) {
if (_root.dropCorrect == 3) {
gotoAndPlay("YES");
} else {
gotoAndPlay("NO");
}
}

I've tried changing every _root instance to _level12 but it's still not working. Any suggestions?

Multi-level Transitions
Ok...so Im practicing transitions between external swf's and I am completely stuck.

My movie has one container clip inside of another container clip...basically a MAIN menu and a SUB menu.

I can get the out transition to work when I am switching between items in the SUB menu, but I want to also find a way that when I hit a MAIN menu button it will transition out which ever SUB menu is loaded first and then transition out the MAIN menu content.

Here is part of the code that I am using on the MAIN menu buttons:


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


There is also a tutorial on how to do out transitions at:
http://www.kirupa.com/developer/mx2004/transitions2.htm
...but it only explains how to work with one container, not a container embedded within another.

Any insite would be GREATLY appreciated!
Katie

Multi Level Arrays
Hello,
Can anyone help me,
I have some arrays within arrays. I want to take an array out of one array and put it in another array. Also i need some way of exporting these changes to a shared object file or a text file, so that i can save the results of these changes.
Thank you.

Please Help Me With A Multi-level Menu
Hello,

I'm trying to make a multi-level drop down menu for a website, and would like some input on how best (simplest) to construct this menu.

The menu is for visiting different countries, and the countries are divided into continents. The very top level is called "Destinations."

Rolling over "Destinations" pulls down a list of "Continents" as a submenu, and rolling over a particular "Continent" rolls out (preferably next to the Continent list) the list of Countries belonging to the Continent. Clicking on the Country takes you to a frame in an externally loaded swf.

The list of countries is updated frequently enough that ease of modification is a factor in choosing how to make this menu.

I saw these nice XML-driven dynamic menus that seemed to be ideal for updating the content, but I have not a clue how XML works. I can do some minor scripting in Actionscript, but I only know how to do a few things (over and over...!).

Could someone give me a suggestion how I should address this? I really appreciate your time in advance.

Thanks guys!

macgirl

Multi Level Swf Forms..
hey all,

i have quite a confusing set up... it consists of "swf_1" (navigation) which loads several other swf's into it. the problem arises as swf_1 masks some content on the other swfs so it must be ontop. however because it is on top i cannot access some input text fields on the masked swfs...


appreciate any help. i was a little ambitious and now just want to get it finished. i cant give up on it..

cheers for any help.

Multi-level Arrays (help Please)
Okay, so I am in the process o fmaking an image gallery, and now that I have gotten so far (okay to the point where this part of the application matters due to placement and loading time issues) I am unabel to get it to work. I have a muti-leveled array in whcih I am storying all of my information for the gallery, it looks somewhat like so:

Array
-images
--gallery 1
---image 1
---image 2
--gallery 2
---image 1
---image 2
--and so on
-titles
--gallery 1
...
you get the point.

Now the problem is that I need to get the length of say Array-images--gallery 1, but it keeps coming up with undefined or NaN when I attempt to trace out the value. Does anyone know what may be the reason for this? How do I get around this type of issue?

This will be used to loop through the images, but only show a max of 27 per page, assuming I can ever get it to work out.

Here is an example of the code I am currently using (and isn't working):


Code:
trace(_galleries['images'][galleryNumber].length);
Where 'images' is simply the sub-array of galleries, and galleryNumber is yet another sub-array, but this time is a variable and not the name of an array.

Thanks for any and all help in advance,
BetaWar

Please Help Me With A Multi-level Menu
Hello,

I'm trying to make a multi-level drop down menu for a website, and would like some input on how best (simplest) to construct this menu.

The menu is for visiting different countries, and the countries are divided into continents. The very top level is called "Destinations."

Rolling over "Destinations" pulls down a list of "Continents" as a submenu, and rolling over a particular "Continent" rolls out (preferably next to the Continent list) the list of Countries belonging to the Continent. Clicking on the Country takes you to a frame in an externally loaded swf.

The list of countries is updated frequently enough that ease of modification is a factor in choosing how to make this menu.

I saw these nice XML-driven dynamic menus that seemed to be ideal for updating the content, but I have not a clue how XML works. I can do some minor scripting in Actionscript, but I only know how to do a few things (over and over...!).

Could someone give me a suggestion how I should address this? I really appreciate your time in advance.

Thanks guys!

macgirl

[fmx04]Can't Create Over And Up Actions For Same Object
I am creating an animated menu for my personal website, but it's turning into much more of a headache than I had originally bargained for! A lot of the tough stuff is working, but now I'm up against a wall.

I know this is long, so let me start with a summary: All I need is a MouseOver and a MouseUp event on the same object.

Because of the scrolling nature of the menu, I need to have MouseOver events on each menutab. Each menu item is hidden until a MouseOver event, then it scrolls out to reveal its title. If the user clicks on the now-revealed tab, it should become the current page. If the user does NOT click the now-revealed tab, it reverts to displaying the current page's tab instead.

This means that I need to have a MouseOver and a MouseUp (or Release) tag on my items. Since I probably confused you all as much as I just confused myself, here is the example.

http://www.stevemarshall.net/test/

The "Family" section should be displayed. As you can see, when the user runs the mouse over other tabs, they are revealed. When the mouse goes away, it reverts to the Family section because nothing else was selected.

The menu operates on frame 2 - frame 1 sets the initial variables as shown.


Code:
var sel = "family";
var games = "0";
var movies = "0";
var artwork = "0";
var yugi = "0";
var about = "0";
var links = "0";
Frame 2 operates my rollovers in a frame action as shown.


Code:
about_mc.btn_about.onRollOver = function() {
if (games == "0") { games_mc.gotoAndPlay("_over"); }
if (movies == "0") { movies_mc.gotoAndPlay("_over"); }
if (artwork == "0") { artwork_mc.gotoAndPlay("_over"); }
if (yugi == "0") { yugi_mc.gotoAndPlay("_over"); }
if (about == "0") { about_mc.gotoAndPlay("_over"); }
if (links == "1") { links_mc.gotoAndPlay("_out"); }

games = "1";
movies = "1";
artwork = "1";
yugi = "1";
about = "1";
links = "0";

gotoAndStop(2);
}
... this section of code is repeated for every tab, adjusting where "1" means the tab is on the left and "0" means the tab is on the right.

I also have another hidden button - it is a border placed over the top of the menu. When the user rolls over this hidden border (when the mouse leaves the menu area), it reverts back to displaying the current menu tab. This is my _level0; the above code is entirely in the movie _level0.menu for organization.


Code:

if (menu.sel == "games") {
if (menu.games == "0") { menu.games_mc.gotoAndPlay("_over"); }
if (menu.movies == "1") { menu.movies_mc.gotoAndPlay("_out"); }
if (menu.artwork == "1") { menu.artwork_mc.gotoAndPlay("_out"); }
if (menu.yugi == "1") { menu.yugi_mc.gotoAndPlay("_out"); }
if (menu.about == "1") { menu.about_mc.gotoAndPlay("_out"); }
if (menu.links == "1") { menu.links_mc.gotoAndPlay("_out"); }

menu.games = "1";
menu.movies = "0";
menu.artwork = "0";
menu.yugi = "0";
menu.about = "0";
menu.links = "0";
}
... and again, this repeats for every section's tab with the appropriate "1" and "0" setting.

I've finally got the animation and MouseOver events done - all I need is a MouseUp event! Can anyone help me figure out why it doesn't accept MouseUp or OnRelease events? Reference files can be provided if they are needed. Thanks so much!

This is, of course, a work in progress. A few artifacts of testing:

* The green squares on the left of each tab are invisible buttons to activate my rollover. I wanted to see them during testing.
* The blue rectangles sometimes visible over the tabs' text was a theory gone wrong; I was hoping I could click those rectangles, which are buttons (which would be invisible) to initiate the MouseUp event instead of the actual tab, which is a movie clip.
* Needless to say, graphics are temporary! LOL
* Coding is also not optimized yet, so it's a little messy for now.

Thanks again!!! Any help would be appreciated.

Multi-level Tree Menu
hi there,

has anybody seen/worked/used a multi level tree menu with multiple nested nodes in flash?

any pointers in this direction?

cheers
mayavi

Problem With Multi-level Menu...please Help
I have a multi-level menu (got the idea from here:
http://www.flashkit.com/movies/Inter...5/index.shtml) and I want to make a third menu level but I'm having a hard time programming it to work right. I'm not sure whether to use a MC for the third level or what, but nothing has been working right.....

Multi Level Drop MenuHelp
I need help creating a multi level drop menu.I have the first level but need help creating a level off of the first level.Also I need is self retracting.

Multi Level Zoom Menu
Hi,

Would anyone have any tutorials on how to create a multi stage zooming menu like in the following demo links?

http://www.bbdo.com/

http://www.saturday-london.com/

Is this done with actionscript or manually tweening several clips? I can't quite seem to get my head around zooming in and out of several layers. I am currently looking into the Laco tween class as a possible solution, but I was hoping that someone might already understand how to achieve this effect.

Any suggestions appreciated
Regards
NTD

Multi-level XML Parsing With Filters.
Updated with solution.

Initial Problem:

I wanted to parse through an XML file using only a single array:


ActionScript Code:
var my Array:Array = ["a", "b"] //for example  


and the unique 'local' attribute on certain nodes.

Solution:

A new class:


ActionScript Code:
package com.rragona.utils.coreXML {        /**    * ...    * @author rragona    * @version 1.0    *     * This class is intended to take a url-style string (i.e. '/news/archive/2751/')    * and path through a given XML object, using node attributes (@local) to     * return a specfic XML object.     *     */        public class XMLPathfinder     {                public function XMLPathfinder()         {            trace('XMLPathfinder is a static class and should not be instantiated.')        }                public static function loopURL(xml:XML, path:String):XML        {            var mA:Array = retPath(path);            var retXML:XMLList = xml.*;                        for (var z:int = 0; z < mA.length; z++)            {                retXML = findMatch(retXML, mA[z])            }            return retXML.parent();        }                private static function findMatch(xml:XMLList, path:String):XMLList        {            var retList:XMLList = new XMLList();                        for (var z:int = 0; z < xml.length(); z++)            {                if (xml[z].@local == path)                {                    retList = xml[z].*;                    break;                }            }            return retList;        }                private static function retPath(path:String):Array        {            var rArray:Array = new Array();            var fP_A:Array = path.split('/');                       for (var z:int = 1; z < fP_A.length - 1; z++)            {                rArray.push(fP_A[z]);            }            return rArray;        }            }    }

Navigation. Multi-level Flash Website
Ok! Here is the problem!

I can make page with some buttons where i can navigate in one level - let's call it Main Page with basic level.
But how can i make subpages in Flash?
I mean - if I press main page button it brings me to page where is another button and this button is linked to different page (not the main page levels).

I think the best way would be to make all pages in new scenes then with button link to specific scene - but how to do that. I need code for this from A to Z. Show how to link to scenes!!!

Multi Level Flash Horizontal Menu
I am trying to create a mulitlevel horizontal flash drop down menu. It's coming along but I have a few issues.
1) I would like to make the text in my Main Menu a different size say (16) and the one in in my sub menu say (12).At present I had to make it 9 for all buttons so that i could fit all my text with some sub menus.
2) When I rollout, the menu i doesn't dissapper until i either rollover another menu item or click on an empty space.
3)I would like it to fit the stage width and not overlap
I have attached my fla code and xml file. Please assist

Vertical Multi Level Menu Tutorials
I am looking for a 3 level vertical menu tutorial in actionscript. does anyone know any? Most tutorial I have came across only shows 2 levels.
this menu works like this. upon click of the button, the subsection is revealed. then click on subsection, the sub sub section is revealed. the main links will drop down to reveal the subsections, the subsection will drop down to reveal the sub sub section. Thanks

Multi-Level HitTest Destroying _globals Help
My dropdown menu contains a hitTest MC that unfolds a section containing another hitTest MC. Buttons in the second level hitTest loose their _globals and I have no clue why. There is some conflict between the hitTests and the _globals.

Example: http://www.earph.com/test.html

The "main" button should stay on when you touch "button 3", like it does when you touch "button 2".

Does anyone have a clue to what's wrong, or possibly know a better way to pull this off?

I appeciate it! .fla is attached!

Multi Level Target Path From String
I'm having trouble converting a string (stored in a database) containing a multi level target path into a working target path. I try to do it this way:


ActionScript Code:
_level0[pathFromDatabase]

It works if pathFromDatabase consists of just one movieclip with an appended textfield variable name like: "clip1.textfield1".

But if there are several nested movie clips in the path: "clip1.clip2.clip3.textfield1", it doesn't work as expected. I can still reach the path through action script, but it doesn't match the actual path:


ActionScript Code:
pathFromDB = "clip1.clip2.clip3.textfield1"
level0[pathFromDB] = "Test"
trace(level0[pathFromDB])
trace(level0["clip1.clip2.clip3.textfield1"])

Gives output:

Code:
Test
Test
But it won't change the text field. Nor is the value accessible with relative paths from inside the clips.

Sorry if the explanation is unclear ...

Does anyone know what's wrong, or a better way to achieve what I am trying to do?

XML Import Using Multi-level Arrays - Lost, Please Help
Hi!

I want to solve a problem that seems quite simple to me, but I simply cannot get through it.

After loading an XML file, I would like to get its data to a structure like this:


ActionScript Code:
main_menu[0].name = "m_name1"
main_menu[0].sub_menu[0].name = "s_name1"
main_menu[0].sub_menu[1].name = "s_name2"
main_menu[0].sub_menu[2].name = "s_name3"

main_menu[1].name = "m_name2"
main_menu[1].sub_menu[0].name = "s_name4"

etc. I think it's understandable what I mean. This would be the basic menu-stucture of a website.

Unfortunately I cannot simply use this kind of stuff, for example:


ActionScript Code:
main_menu[0].sub_menu[0].name = MyXml.firstNode.childNodes[0].childNodes[0].name;

I should have to use the push method, but I'm lost while trying to do it in this "multi-level environment".

Can anybody help what's the correct way to embed the for...in cycles and write the push methods in order to retrieve the structure above?

Thank you in advance for your help!

Dynamic Flash Multi Level <ul> In MyHTMLdata
I am on a Mac, by the way, so I don't have an alt key for special characters.
The following code works great tested in Dream Weaver, but only displays as a one level <ul> in a dynamic Flash 8 text field:

myHTMLdata=<ul><li>Complete collection of data by source<ul><li>Diagnosis</li><li>Medications</li><li>Other data: height/weight; smoking; ADL</li></ul></li><li>Smart system: requirement ordering & tracking</li><li>Integrated underwriting & claims databases</li></ul>

This is more legible in code view, but does not work correctly in Flash 8:
myHTMLdata=
<ul>
<li>Complete collection of data by source
<ul>
<li>Diagnosis</li>
<li>Medications</li>
<li>Other data: height/weight; smoking; ADL</li>
</ul>
</li>
<li>Smart system: requirement ordering & tracking</li>
<li>Integrated underwriting & claims databases</li>
</ul>

Help Please!!

Multi-Level HitTest Destroying _globals Help
My dropdown menu contains a hitTest MC that unfolds a section containing another hitTest MC. Buttons in the second level hitTest loose their _globals and I have no clue why. There is some conflict between the hitTests and the _globals.

Example: http://www.earph.com/test.html

The "main" button should stay on when you touch "button 3", like it does when you touch "button 2".

Does anyone have a clue to what's wrong, or possibly know a better way to pull this off?

I appeciate it!

HitTest On A Multi-Level Popup Menu
So in this post I asked for some help with hitTest on a popup menu and got a perfectly working answer from TheCanadian.

I was just looking for a way to have a flyup on my menu buttons that opened on mouseOver and closed when the mouse left.

TheCanadain gave me this code and it works nicely:
ActionScript Code:
onClipEvent (load) { newy = _y - 45; oldy = _y; vel = 15;}onClipEvent (enterFrame) { if (this.hitTest(_root._xmouse, _root._ymouse, true)) {  _y += (newy - _y) / vel; } else {  _y += (oldy - _y) / vel; }}
Now! I've got an extra spin on the menu as I need to have sub menus.

Here's an example of the menu I'm building:



I've tried a few things but am hitting a brick wall so I thought I would ask.

Any help will be greatly appreciated.

Multi-Level HitTest Destroying _globals Help
My dropdown menu contains a hitTest MC that unfolds a section containing another hitTest MC. Buttons in the second level hitTest loose their _globals and I have no clue why. There is some conflict between the hitTests and the _globals.

Example: http://www.earph.com/test.html

The "main" button should stay on when you touch "button 3", like it does when you touch "button 2".

Does anyone have a clue to what's wrong, or possibly know a better way to pull this off?

I appeciate it!

Alert Component + Multi Level Flash App
Hi Experts,

Im having a nightmare with trying to display an alert window in my flash movie. It works if the parent of the alert is the same movie. However as soon as i call that same swf from a different swf using the loadMovie method i can no longer see the alert window.

As you can see this is how i call the actionscript.
if i trace(this) in the "child" swf [one that contain the alert] is get _level0.mc_clip.content , where mc_clip is the movie clip symbol i use.

mx.managers.PopUpManager.createPopUp(_root0,mx.containers.Window,true,           {contentPath:"login",  closeButton:true, title:" vpfm.Net Status", _x:x, _y:y});

Any ideas ?

(FMX04) Can't Set Shared Object To Keep Track Of Place In Movie
I'm trying to implement a css theme switcher for the background image of the page that contains the flash movie, so that it changes the background based on what part of the movie the user navigates to.

I have a test file up at http://www.lilana.com/test/. I made the buttons work, in that if you push 'style 1' the background becomes the spotty black and white one, and if you push 'style 2', the background is the repeating faces down the right side, but the problem I'm having is that when I switch, the flash movie reloads and always displays scene 1, frame 1.

Ideally this is what's supposed to happen:
style 1=spotty background, flash file says 'crackas' (scene 1, 1)
style 2=face background, flash file says 'cheez' (scene 2, 1)

As you can see, if you push 'style 2', it says 'cheez' for one second, and then reloads with the new bg and we're back to scene 1.

I'm trying to use a shared object to fix this, where a cookie will be set based on the style chosen, which will then be read by the movie and make the movie move to the appropriate scene when it reloads with the new background. This is the actionscript I'm using in scene 1, frame 1 (frankensteined from a similar example tutorial that wasn't doing exactly the same thing I was--which is probably why it doesn't work):

stop();

myLocalSO = sharedobject.getLocal("csschangefla" );

if (myLocalSO.data.ldpage = style2) {
gotoAndPlay("Scene 2", 1);
}

else {
stop();
}

style1.onPress = function() {
myLocalSO.data.ldpage = style1;
}

style2.onPress = function() {
myLocalSO.data.ldpage = style2;
}


What's going wrong? Why won't it set the cookie? Why won't it read the cookie if it's being set? Help!

Edit: before I included the above actionscript, it was misbehaving like I described. Now that I included the script (and cleared my internet cache (duh)) I can see that it won't even run because it keeps insisting that the script is making flashplayer 8 run too slowly, and asking me if I want to abort the script. Why??? Shouldn't this whole operation be fairly painless?

[FMX04] - Transitions, Flag Variables? - S.O.S
Hi Guys

I have hunted for the answers to this question and tried to work it out myself, but I have ended up more confused. I am more of a designer than a coder so if you answer, please speak slowly

Basically I have a movie with 6 sections. The first 5 options call movies from the library using attachMovie. The 6th option plays all the setions in sequence. We can forget this for now.

Back to the first options. How i need these to work is as follows: (Please see attached .fla)

When the user only wants to see one section, they click the button, the white box opens, the arrow points to the menu option and some content will load in. They then close the white box when they are done with the content animating out first. No problems there. But if the user is in a section as explained above, and they want to go to another section, i want the content to animate out, then the arrow to move to the next section and then the new content to load in. The procedure is the smae as above when closing.

Someone suggested using flag varibales but I am not really familiar with such good things. Does this make any sense. Any help would be awesome!!!! I think I need to set a variable (false) in the first frame of the main timeline. Then on the buttons use if...else statements. I am not sure where to put the varialble value = true. Sorry I dont have more.

Many thanks

FMX04 - Control Variables In LoadVariablesNum
Hi!

I'd like to know if there is a way of controlling the variables that are sent with the AS command loadVariablesNum when calling an ASP.
Let's say I don't want to send two variables that exist in that frame.
How can you do that?
thanks!

FMX04 - Control Variables In LoadVariablesNum
Hi!

I'd like to know if there is a way of controlling the variables that are sent with the AS command loadVariablesNum when calling an ASP.
Let's say I don't want to send two variables that exist in that frame.
How can you do that?
thanks!

Multi-Color Text
I have multiple input text fields and each one is a different color. I also have one dynamic text field that is displaying the concatenated text from all the input text fields. Inside the dynamic text field I'm using htmlText with font tags to show the input text strings in their respective color. This works great except when dealing with some special characters. For example I would like to be able to type in a greater than '>' or less than '<' symbols and have them appear in the dynamic text field in the correct color. Obviously these and certain other symbols seem to interfere with the htmlText so I need a good way to have multiple colors of text in the same text field without risking interfering with the html formatting.

Thanks,

Carriker

Multi Color Dynamic Text
I made a clock class that sends the time to a Var named _root.Time

it's displayed as this

// 12:00:00 AM //

I want to make it with more color so it ends up like this.

// 12:00:00 AM //

well this is my class I made just to see what I have


PHP Code:



//////////////////////////////////////////////////////
/////// Make a call to TimeNow.RightNow();
/////// Time displayed in Var _root.Time
/////// Made by josh chernoff  joshchernoff@msn.com
//////////////////////////////////////////////////////
class TimeNow extends Date {
    static function RightNow() {
        _root.onEnterFrame = function() {
            //Vars for getting time
            var N = new Date();
            var H = N.getHours();
            var M = N.getMinutes();
            var S = N.getSeconds();
            var AmPm:String;
            //if Am or PM
            if (H<12) {
                AmPm = "AM";
            } else {
                AmPm = "PM";
            }
            
            //change from 24 hours to 12 hours
            if (H>12) {
                H = H-12;
            }
                        // if 00 hour on 12:00
            if (H == 0) {
                H = 12;
            }
            // put in 0 if single number 0-> + N = NN;  
            if (H<10) {
                H = "0"+H;
            }
            if (M<10) {
                M = "0"+M;
            }
            if (S<10) {
                S = "0"+S;
            }
            //Makes format of display  
            _root.Time = "// "+H+":"+M+":"+S+" "+AmPm+" //";
        };
    }
}

Multi Player Game
hi everyone,

i saw many multiplayer flash games on the internet, i want to know if it is possible to develop a multiplayer game using action script.

if not, then how are these games done?

see this link as an example:
http://www.guessasketch.com/play/

thxx

Multi Player Game
hi everyone,

i saw many multiplayer flash games on the internet, i want to know if it is possible to develop a multiplayer game using action script.

if not, then how are these games done?

see this link as an example:
http://www.guessasketch.com/play/

thxx

Multi User Game
hi does anyone no how to set up a multi user game ... or i am going to develop a drawing bored that all the users can look at while one person is drawing... and everyone can see it at the same time.. does anyone know how to do this???

A Multi Player Game
Hey Guys,

I need some help with the actionscripting logic on this.
I'm creating a 3 point shooting game in flash 8 and I have an animation associated with 4 different players in the game. What I'm puzzled over is the issue of trying to connect those movie clips with the choice made buy the user.

Let me clarify the issue I have a 4 players in the game (2 male 2 female) when picked lets say (player 2) I want the player 2 skin to be the movie clip that plays in the game.

How do I have all the code for the game be the same but based on the users response change which player (movie clip) the user will use in the game.

Thanks

Multi User Game
hi does anyone no how to set up a multi user game ... or i am going to develop a drawing bored that all the users can look at while one person is drawing... and everyone can see it at the same time.. does anyone know how to do this???

Component Text Color, Multi-choice
Im trying to change the text color and attributes in a multiple choice quiz, but i have no clue where that is located in the macromedia premade templetes...plz help...

How Do You Make A Multi User Game?
1.It may seem like a stupid question to some, but how do you make a multi player game? Can it be done by an idiot like myself or do I need to know
scripting up the wazoo?

2. Is there a tutorial or sample script to look at to do it?

thanks for humoring me...

Andy
http://www.art-barn.com

Flash Multi-User Game
Anyone have any expericene coding a multi-user game in Flash? I'm going to start a project soon making one and was just wondering if anyone had used any of the available engines out there. Any advice/feedback would be appreciated.

Thanks

Multi-PLayer Game Tutorials
I have a project coming up that requires multi-player capabilities.
Does anyone know of a book or online tutorial site that takes you through the basics on how to get started?
I know that it requires Flash Media Server, but that's about it.
Any help to get started would be welcome.

[FMX04/AS2.0]Customizing FMX04 Components (label)
Hello, I'm trying to find a clear and concise book or online referece that can assist me in customizing the components that come with FMX04.

Namely the label component. I know how to change the "halo" theme in general to get the buttons and text boxes to change color, but beyond that I am at a lost.

I have tried Macromedia, searched here/Flash Kit/google, but nothing that I can learn from. Live Docs has a feedback part where someone posted some code and while I can cut and paste it, I'm not completely sure how it all worked.

And if I can't figure it out then its just not as fun.

Any help would be greatly appreciated. Focusing on the label component, but any and all are welcome!

Thanks.

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