Help Im Maken Ta Ranking System Pls Read.
I need to create a ranking system were it loads names from mysql but when it loads the names it creats a movie clip so each name has its own movie clip and can be dragged on the stage to numbers 1, 2, 3 etc... so the team names can be ranked. does any one have any idea how this can be done thanx. down blow is what the rankings.php file displays it grabs data from my sql and displays the team names from the data base <? $num = $_GET[num]; $div = $_GET[div]; $conf = $_GET[conf];
$user = "root"; $pass = "zebzabdallas"; $db = "league"; $conn = mysql_connect( "localhost", $user , $pass ); if ( ! $conn ) die( "Couldn't connect to the database" ); mysql_select_db( $db, $conn ) or die( "Couldn't open $db: ".mysql_error() ); $i = 0; while ($rank = mysql_fetch_array($ranksql)) { echo "name".$i."=".$rank
$ranksql = mysql_query("SELECT s.id, s.rpi, t.name, t.id, t.conf FROM ".$div."_standings AS s, ".$div."_teams AS t WHERE s.id = t.id AND t.conf = '$conf' ORDER BY s.rpi DESC LIMIT $num"); [2]."&id".$i."=".$rank[3]."&"; $i++; } ?>
ok so when the above code is executed it then shows whats below i need this info to be loaded into flash like i explaind above.
name0=Green Berets&id0=945&name1=eGameHall.eVo&id1=817&name2=W eb&id2=967&name3=crisis Factor&id3=955&name4=Constantly Bored Crustaceans&id4=960&name5=MamazKillaZ&id5=716&name 6=havok eXtreme&id6=947&name7=No Such Agency&id7=1005&name8=echoes of silence&id8=1012&name9=Hard Clan&id9=948&name10=Initial&id10=1017&name11=Den!e d&id11=1002&name12=So Owned But Why&id12=926&name13=draino&id13=963&name14=In Your Eye&id14=969&name15=cruciaL&id15=1016&name16=Fear Factor&id16=949&name17=f5&id17=946&name18=Familia& id18=903&name19=The Mercenary Outpost&id19=392&name20=adverse Reality&id20=959&name21=drift&id21=1004&name22=Exp ect Zero Error&id22=925&name23=skoal Mint&id23=966&name24=Pride Over Ego&id24=954&name25=Eternal Dust Legends&id25=865&name26=Legion of Fallen Souls&id26=662&name27=Apocalyptic Fate&id27=953&name28=4bidden&id28=964&name29=Out of Focus&id29=899&
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 02-26-2004, 05:00 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Help Im Maken Ta Ranking System Pls Read.
I need to create a ranking system were it loads names from mysql but when it loads the names it creats a movie clip so each name has its own movie clip and can be dragged on the stage to numbers 1, 2, 3 etc... so the team names can be ranked. does any one have any idea how this can be done thanx. down blow is what the rankings.php file displays it grabs data from my sql and displays the team names from the data base
<?
$num = $_GET[num];
$div = $_GET[div];
$conf = $_GET[conf];
$user = "root";
$pass = "zebzabdallas";
$db = "league";
$conn = mysql_connect( "localhost", $user , $pass );
if ( ! $conn )
die( "Couldn't connect to the database" );
mysql_select_db( $db, $conn )
or die( "Couldn't open $db: ".mysql_error() );
$i = 0;
while ($rank = mysql_fetch_array($ranksql)) {
echo "name".$i."=".$rank
$ranksql = mysql_query("SELECT s.id, s.rpi, t.name, t.id, t.conf FROM ".$div."_standings AS s, ".$div."_teams AS t WHERE s.id = t.id AND t.conf = '$conf' ORDER BY s.rpi DESC LIMIT $num");
[2]."&id".$i."=".$rank[3]."&";
$i++;
}
?>
ok so when the above code is executed it then shows whats below i need this info to be loaded into flash like i explaind above.
name0=Green Berets&id0=945&name1=eGameHall.eVo&id1=817&name2=W eb&id2=967&name3=crisis Factor&id3=955&name4=Constantly Bored Crustaceans&id4=960&name5=MamazKillaZ&id5=716&name 6=havok eXtreme&id6=947&name7=No Such Agency&id7=1005&name8=echoes of silence&id8=1012&name9=Hard Clan&id9=948&name10=Initial&id10=1017&name11=Den!e d&id11=1002&name12=So Owned But Why&id12=926&name13=draino&id13=963&name14=In Your Eye&id14=969&name15=cruciaL&id15=1016&name16=Fear Factor&id16=949&name17=f5&id17=946&name18=Familia& id18=903&name19=The Mercenary Outpost&id19=392&name20=adverse Reality&id20=959&name21=drift&id21=1004&name22=Exp ect Zero Error&id22=925&name23=skoal Mint&id23=966&name24=Pride Over Ego&id24=954&name25=Eternal Dust Legends&id25=865&name26=Legion of Fallen Souls&id26=662&name27=Apocalyptic Fate&id27=953&name28=4bidden&id28=964&name29=Out of Focus&id29=899&
Ranking System
I'm looking for an easy way to label the players of my game. The entire purpose of the game is to achieve the highest rank.
Each time you succesfully beat an opponent you can either gain .1, .5, or 1 points.
And that makes it very hard to make a ranking system using an array.
ActionScript Code:
//Progresses by 5's up to 35, hence the small point gains
rankList= new Array("Rank1","Rank2","Rank3","Rank4","Rank5","Rank6");
rank=5;
//Later on where you display the rank name
if(rank<=9.9){
rank_txt.text=_root.rankList[0];
}
if(_root.rank>=10 && _root.rank<=14.9){
rank_txt.text=_root.rankList[1];
}
etc...
I could type that all out, but it makes me feel like I'm working on my old TI-83 Graphing Calculator (Graphing Calculator that had a basic programming setup on it similar to a minituarized form of PERL). Is there no more efficent way of doing things?
Note:I want to use the Array for two reasons 1.) in case I figure out a formula working with other components of the game and 2.)Because it's easier to organize the names in case I want to change it.
Thanks for any help or responses.
Read File System
I would like to present a photo album. For this I want to load the thumbnails and previews. Instead of naming the photos something like prev001.jpg, prev002.jpg etc I want to use the original Photo names. Is there a way of reading all the file names in a directory and fill an array with these names? I don't know the way to read a directory content. The solution I need is for AS3. (the way via php is clear to me, i search a solution directly out of Flash)
Thanks for your help
Didi
Edited: 12/24/2007 at 10:52:32 AM by didi.thinkpad
Screensaver Changes Overtime Via Read System Clock
Hi there all,
I looking at making a screensaver that changes over time. i.e. I want actionscripit to detect the time from the system clock and depending on the time alter the state of the movie playing...for example darkens the sky in the screen saver....tells you it is saturday and you shouldn't be at work..turns the sun to a moon..etc...
Want I want to know is this possibile....
any thoughts!..any known examples to look at....
cheers...out there..enjoy your day!
stu
__________________
stuart petri
stuart@navyblue.com
Can Flash Read Text File And System Date?
Flash newbie, way newbie here. I am working on a project where I need a swf file to read a parsed text file, and based on the system date, place text into the swf to be viewed. Is this possible, how do I go about it.
The end result is to have a flash movie that will run content for a year (365 entries in file). Other wise I am going to have to create 365 different ones.
Hopefully this made sense and is doable.
Thanks in advance
Example file with two entries
07042002~The Brave and the Bold~
07052002~The Stupid and the Clueless~
Ranking?
I was not sure where to post this but I need some help and advice on getting my flash websites high up on Google,Yahoo,etc. I have read acticles on this and they say stay away from Flash that it does not rank well. I know this is BS, But how do I move my website up in the ranking fast on the big engines?? Are there programs or just tricks? Any help is appriciated.
Thanks
Ranking
Okay, so I've finally got a Flash-generated Website with one major drawback: seach engine bots can't read its contents. What can I do to still achieve a satisfactory ranking (other than meta-tags) ?
THX,
aut.
Flash + Ranking
Hi everyone,
Is it true that you can't have a good ranking with search engine when you create your site in flash ?
If yes, is there a way to get better ranking with flash ?
Cheers
Ranking List
i have a question, for example, there are many players to player to play a game, they get different marks, 80, 86,70.......how can i make a list and the mark is in desending order. if there is one player want to join the game, and he score 99 mark , how can i add his mark to the ranking list
No Search Engine Ranking
I have built my site using Flash on a single webpage. I have reconstructed the flash site as a multi-page HTML site just for search engines but I am getting no results at all. Any ideas?
The site is www.gazzanewpy.me.uk and is officially launched from 1st March but would like to see it listed at least (even if not highly) in most search engines.
I have used a description meta-tag and keywords as well.
Realtime Voting/Ranking With Flash
Hi, I am trying to put realtime voting into my webpage so that users can vot for music and click a button and have the average of all the votes apear on the screen. Can anyone help with this?
Flash Page Ranking In Google
Hello,
I have questions about ranking of web pages which are made with flash.
For example if all my page is made with flash and embedded in xhtml how can I increase it search result in google?
I heard what google's robots cant search inside of swf file, so how can I make visible content of web page to users in google?
How To Improve Ranking Of A Flash Website
Hello everyone,
I have create a website using Flash, php, and MySQL. The website dynamicly loads the entire text and image in the Flash.
Now I wish to improve the website ranking in google search engine. I undrestand that google search engine ranks the website base on how many website has pointed in the the one that we are intrested in its ranking. Do advertising the website improves its ranking? After, google cannot read the text of my flash website. I am just puzzled with the entire issue and was wondering if someone can be kind enough to help me on this.
Thank you very much and have a great day.
Khoramdin
Popularity, Ranking - Time On Page
I am enquring as I wish to add a 'behind the scenes' most popular ranking element to my site, thus not only by clicks but by time spent on a page.
Thus ideally indicating which pages are of most interest.
Does this sound reasonable?
Search Ranking For Flash Content
DOes anyone know how I can improve the search ranking for pages with mainly Flash content. I have included META data including keywords, title and description for the pages into which the Flash files are embedded but still, even our own search engine does not seem to index them highly or at all...?
Flash Sites And Search Engine Ranking....... Help
first off, i have only a few months experience with flash and website design and all that good stuff. so i really have no idea what im talking about.
here comes the problem...
i have a 100% flash site; http://www.gmhwebdesign.com. I need to optimize it for search engine rankings, but the problem is that its only flash. I have set up all the meta tags, tried making "invisible" text (and realized i would get penalized for spamming, so i took that off), and i had decent keyword desnity in the "invisible" content.
i dont know how it's rank came out, as its so new (i set it up a few days ago) that the search engines haven't updated since.
how can i get it optimized for search engines without a complete redeisgn to minimize the flash content? Im considering keeping the flash page, creating a html index, and then a regular html site, with maybe some flash. but then again i dont really now what im talking about.
any help, suggestions, comments, ANYTHING, is greatly appreciated.
Ranking Game That Captures User/their Ranks/date Into A Database.
Sorry about the subject, it is hard to explain in one line.
I'm using Flash CS3, AS2, PHP, mysql database with phpbb user registration.
What I'm trying to do is a make a contest game where you have 5 different ladies and the users get to rank them in order from 1 to 5. Since it is a contest, users will need to be logged in. We already have a database of users based on phpbb, and a registration page. I need them to be able to log in using that username/pass and then they can play the game.
The game consists of a drag and drop mechanism (which I have) so the user can drag "#1" to "girl-4", drag "#2" to "girl-5" etc. Once they drag and drop all the boxes into the order they want, the user then submits it. The data I need to capture in the database is the User, date/time, their rank order (seperated so we can do a query to figure out how many they got right out of the 5.) The final twist is that we are going to have 9 total 'games', one each week for 9 weeks, and we only want users to be able to play once per week.
For an example you can see a working version here. That one does a bunch of more complicated stuff that I don't want to do. The programmer that did it is no longer here and it has been hard trying to decipher his code.
I have the whole drag and drop mechanism using the old code from the above example. This is a snippit of the code. drag1_mc is the number they drag (there are 5, so drag1_mc, drag2_mc etc.) and drop1_mc is the rank location. (also 5, drop1_mc, drop2_mc, etc)
actionscript Code:
Original
- actionscript Code
// allow the movieclips to be dragged by mouse
// start drags?
drag1_mc.onPress = function()
{
startDrag(this);
};
//
// drop them..
// drag 1 gets dropped on drop1
// else goes back to start position
drag1_mc.onRelease = function()
{
var whereput = undefined ;
this.stopDrag();
if (eval(this._droptarget) == drop1_mc) {
// leave it there
this._x = drop1_mc._x;
this._y = drop1_mc._y;
_root.grid[1]['userplacement'] = 1 ;
whereput = 1 ;
} else if (eval(this._droptarget) == drop2_mc) {
// leave it there
this._x = drop2_mc._x;
this._y = drop2_mc._y;
_root.grid[2]['userplacement'] = 1 ;
whereput = 2 ;
} else if (eval(this._droptarget) == drop3_mc) {
//leave it there
this._x = drop3_mc._x;
this._y = drop3_mc._y;
_root.grid[3]['userplacement'] = 1 ;
whereput = 3 ;
} else if (eval(this._droptarget) == drop4_mc) {
//leave it there
this._x = drop4_mc._x;
this._y = drop4_mc._y;
_root.grid[4]['userplacement'] = 1 ;
whereput = 4 ;
} else if (eval(this._droptarget) == drop5_mc) {
//leave it there
this._x = drop5_mc._x;
this._y = drop5_mc._y;
_root.grid[5]['userplacement'] = 1 ;
whereput = 5 ;
} else {
// take back to start pos
this._x = start1x;
this._y = start1y;
}
if (whereput == undefined) {
this._x = start1x;
this._y = start1y;
}
};
// allow the movieclips to be dragged by mouse// start drags?drag1_mc.onPress = function(){ startDrag(this);};//// drop them..// drag 1 gets dropped on drop1 // else goes back to start positiondrag1_mc.onRelease = function(){ var whereput = undefined ; this.stopDrag(); if (eval(this._droptarget) == drop1_mc) { // leave it there this._x = drop1_mc._x; this._y = drop1_mc._y; _root.grid[1]['userplacement'] = 1 ; whereput = 1 ; } else if (eval(this._droptarget) == drop2_mc) { // leave it there this._x = drop2_mc._x; this._y = drop2_mc._y; _root.grid[2]['userplacement'] = 1 ; whereput = 2 ; } else if (eval(this._droptarget) == drop3_mc) { //leave it there this._x = drop3_mc._x; this._y = drop3_mc._y; _root.grid[3]['userplacement'] = 1 ; whereput = 3 ; } else if (eval(this._droptarget) == drop4_mc) { //leave it there this._x = drop4_mc._x; this._y = drop4_mc._y; _root.grid[4]['userplacement'] = 1 ; whereput = 4 ; } else if (eval(this._droptarget) == drop5_mc) { //leave it there this._x = drop5_mc._x; this._y = drop5_mc._y; _root.grid[5]['userplacement'] = 1 ; whereput = 5 ; } else { // take back to start pos this._x = start1x; this._y = start1y; } if (whereput == undefined) { this._x = start1x; this._y = start1y; }};
So using that as a starting point I need to figure out how to do a flash user/pass login using the phpbb database, and then figure out how to record the location of the dragged movie clips along with user/date back into the database.
Any kind of help anyone can provide for this would be greatly appreciated even if it is just for a piece of it. Thanks!
[MX04] Improving Google Search Ranking For A Flash Base Website
hello all...
i understand the basic concept of how search engines work and why it's better to use HTML when ranking is a priority for your site... that said, for sites that are entirely Flash, how do you get better ranking results?
i just finished a new site (http://www.hudsonvalleyyachtcharters.com) and discovered an interesting problem... if you Google any of the key words (hudson, valley, yacht, charters), the site doesn't pop up at all in the results, but if you type the words all together (as in the URL), it pops up immediately... i assume this is because the .swf file is named with those words running together... would putting spaces between the words in the file name help? i was told that is not a good practice for various reasons...
anyway, here is the code for the HTML page that contains the .swf file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="hudson river, new york, yacht, boat, cruise, ship, charter, catering, wedding, special event, meeting"/><meta name="description" content="Hudson Valley Yacht Charters. Your connection to the finest vessels on the Hudson river. Serving Poughkeepsie, Peekskill, Tarrytown, Haverstraw, Nyack, New York City and New Jersey."/>
<title>Hudson Valley Yacht Charters</title>
</head>
<body bgcolor="#ffffff">
<div align="center">
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
any thoughts as to what i'm doing wrong or could do differently???
thanks.
Bought CS3 But Haven't Read My MX Actionscript, MX2004, Books. Should I Read Them?
I just bought CS3 and I am now debating whether I should read my Flash MX Actionscript bible, Flash 2004 Bible. I should have read them, but It's just hard to fit the time in.
Would I benefit from reading these books when CS3 is Actionscript 3? How much functionality is lost when scripting in Actionsript 2 and 1 as compared to Actionscript 3.
Would it be wiser for me to just learn Actionscript 3 properly and get a book on Actionscript 3 than waste my time on reading old scripting and technology?
Also is MC tween compatible on CS3, actionscript 3.
What Does System.capabilities.language Return On Your System?
I am working on a multi-lingual web site that automatically detects the user's OS or browser language by using System.capabilities.language .
Since I am running a german OS/browser, this returns 'de' in my case, but I wonder what it returns on other systems (english, french, spanish etc.)
To find this out, please copy and paste this code into a Flash doc and see what it says:
trace( System.capabilities.language );
Thx!
Mike
System.pause(); And System.resume();
I've been looking for a simple way to pause everything inside the flash player when a user clicks on a pause button. I found what I thought to be a solution by running System.pause() method. This sounds funny but the problem is that this method does exactly what it's supposed to do, meaning it pauses EVERYTHING.
There is another System method call resume(). But with the entire player pause, how is one supposed to call this method when the pause button is clicked a second time?
This is what I thought about using:
ActionScript Code:
public function pauseSystem(evt:MouseEvent):void {
if(!sytemPaused){
sytemPaused = true;
System.pause();
} else {
sytemPaused = false;
System.resume();
}
}
But once the pause() method runs, nothing is clickable. I've got tons of event listeners and things happen all at once, so I'd rather not have to go through removing and adding event listeners every time the user clicks a pause button. Any ideas? Thanks.
READ Mc.hitTest(mc2) Needed Please Read And Help
I've looked and looked but can't find one tutorial that works for hit tests.
player = g
box = box
I need a script for when "g" hits "box" "g" reboundes a bit
thx
see attachment if you are questioned about my stuff
DON'T LAUGH AT THE GRAPHICS! I'LL CHANGE THEM LATER!
Ok I Have Read And Read, But I Am Getting No Where. Please For The Love Of God Help
Ok I have developed an interactive map, by which the user clicks a button and information pops up into the dynamic box taking this from nodes in my XML file.
The client has requested the availability in typing information into the dynamic box (area), so really I need to change this into an input box, fine.
But then to click a save button, for the xml file to be passed the information, thus next time the information is presented on click of a button, as many buttons are applied to many nodes in the xml tree, i.e cw1, cw2, cw3 and so on.
I CANNOT DO IT!
I stress this because I am at my end, its taking me ages to get the data into a flash window from each node, and there are many. But now I am attempting to undertake the impossible. I have looked at tutorials from sencular, who really does know his stuff, but cannot do it.
It would be really kind if someone could help me for a simple approach dispite it not being simple as I dont have much time, and I am rushed.
So I am in desperate need right about now, so please help me.
So my aim is for the client to input data into the area after clicking a button, as currently I just have bogus text in each field, but they will be able to overwrite this in real time.
I am sure that asp, xml and flash are required to achieve this, thats fine, but I need help.
Tell me with it being an internal thing could we pass the information in holding into a secondr swf file.?
This is not for the internet, but an internal intra net.
Kindest regards for anyone willing to reply
I Really Like This NAV System
I really like this nav system and would like to recreate it.
http://www.frontmedia.co.uk/
If some one could point in the right direction that would be great.
thanks
readyornot
Tab System?
How can I make a tab system which loads html files in a specific tab?
Suppose I create a Flash movie clip containing a tab system and on each tab the HTML file is loaded in a frame just below the frame housing the Tab movie clip while bringing the appropriate tab to the foreground. Is there a way to change the HTML file on a tab and/or bring up a different tab to the foreground by sending the HTML linked URL to the Flash movie via JavaScript or something like that. I'm trying to send/translate a variable with a URL as a value to a movie clip and then load that URL's file onto the relevant tab's "page".
Thanks for any help or hints...
jruben
How To Do A F1 Nav System
hi,
i want to do a navigation system similar to the F1 system (the one on the right side).
http://www.f1play.com
i got heaps of links to show in a list one after the other, so i think this would be a nice solution... could anyone give me a hint?
cobo
Help With Map Pin System
Well here is the deal.
I have a map of my country (Greece) and i want to place pins on it to point out the places i have been, links to photos etc, files etc.
I want you to guide me at how to make my programm to remember where i've placed those pins. Should i save the x,y location of the every pin to a table at a database for example and fetch them at loading?
Help With A Tab System
Hey all.. I'm trying to make a tab system and I'm having a problem with clicking on one tab, and then having that tab call a function that resets the appearance of any other tabs that are "on" to "off" Here is basically what I have here:
It all works, but I don't know how to have All instances of the Tabclass respond to the RESET_BUTTON event. I can't seem to figure out how to address the displayList or?????
Thanks in Advance!
C
Tabclass.as
Code:
package com.mysite.testing {
import com.mysite.testing.DisplayContent;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.text.TextFormatAlign;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.events.*;
public class TabClass extends Sprite{
private var _totalTabs:Number;
public function TabClass(pos:Number, totalTabs:Number):void {
_totalTabs = totalTabs;
var dataLoader:Sprite = new Sprite();
dataLoader.name = "dl"+pos;
if(pos==0){
dataLoader.graphics.lineStyle(1, 0xcccccc, 1, true);
dataLoader.graphics.beginFill(0xcccccc, 1);
}
else{
dataLoader.graphics.lineStyle(1, 0xa9a9a9, 1, true);
dataLoader.graphics.beginFill(0xa5a5a5, 1);
}
dataLoader.graphics.drawRect(0, 0, 114, 23);
dataLoader.graphics.endFill();
dataLoader.addEventListener(MouseEvent.CLICK, clickMe);
dataLoader.addEventListener(ResetButtonEvent.RESET_BUTTON, buttonReset);
var boxName:TextField = new TextField();
boxName.text = "Testing";
boxName.width = 110;
boxName.height = 25;
boxName.mouseEnabled = false;
boxName.wordWrap = true;
var boxNameFormat:TextFormat = new TextFormat("Trebuchet MS", 11, 0xffffff, true, null, null, null, null, TextFormatAlign.CENTER);
boxName.setTextFormat(boxNameFormat);
dataLoader.mouseEnabled = true;
dataLoader.buttonMode = true;
trace("TabClass working");
var displayContent:DisplayContent = new DisplayContent(10);
dataLoader.addChild(boxName);
addChild(dataLoader);
}
private function clickMe(evt:MouseEvent):void{
evt.target.dispatchEvent(new ResetButtonEvent());
evt.target.graphics.clear();
evt.target.graphics.lineStyle(2, 0xCCCCCC, 1, true);
evt.target.graphics.beginFill(0xCCCCCC, 1);
evt.target.graphics.drawRect(0, 0, 114, 23);
evt.target.graphics.endFill();
}
private function buttonReset(evt:ResetButtonEvent):void{
trace("halp");
}
}
}
ResetButtonEvent.as
Code:
package com.mysite.testing{
import flash.events.*;
public class ResetButtonEvent extends Event{
public static const RESET_BUTTON = "resetButton";
public function ResetButtonEvent():void{
super(RESET_BUTTON);
}
}
}
AS3 - Tab System
Hey all.. I'm trying to make a tab system and I'm having a problem with clicking on one tab, and then having that tab call a function that resets the appearance of any other tabs that are "on" to "off" Here is basically what I have here:
It all works, but I don't know how to have All instances of the Tabclass respond to the RESET_BUTTON event. I can't seem to figure out how to address the displayList or?????
Thanks in Advance!
C
Tabclass.as
Code:
package com.mysite.testing {
import com.mysite.testing.DisplayContent;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.text.TextFormatAlign;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.events.*;
public class TabClass extends Sprite{
private var _totalTabs:Number;
public function TabClass(pos:Number, totalTabs:Number):void {
_totalTabs = totalTabs;
var dataLoader:Sprite = new Sprite();
dataLoader.name = "dl"+pos;
if(pos==0){
dataLoader.graphics.lineStyle(1, 0xcccccc, 1, true);
dataLoader.graphics.beginFill(0xcccccc, 1);
}
else{
dataLoader.graphics.lineStyle(1, 0xa9a9a9, 1, true);
dataLoader.graphics.beginFill(0xa5a5a5, 1);
}
dataLoader.graphics.drawRect(0, 0, 114, 23);
dataLoader.graphics.endFill();
dataLoader.addEventListener(MouseEvent.CLICK, clickMe);
dataLoader.addEventListener(ResetButtonEvent.RESET_BUTTON, buttonReset);
var boxName:TextField = new TextField();
boxName.text = "Testing";
boxName.width = 110;
boxName.height = 25;
boxName.mouseEnabled = false;
boxName.wordWrap = true;
var boxNameFormat:TextFormat = new TextFormat("Trebuchet MS", 11, 0xffffff, true, null, null, null, null, TextFormatAlign.CENTER);
boxName.setTextFormat(boxNameFormat);
dataLoader.mouseEnabled = true;
dataLoader.buttonMode = true;
trace("TabClass working");
var displayContent:DisplayContent = new DisplayContent(10);
dataLoader.addChild(boxName);
addChild(dataLoader);
}
private function clickMe(evt:MouseEvent):void{
evt.target.dispatchEvent(new ResetButtonEvent());
evt.target.graphics.clear();
evt.target.graphics.lineStyle(2, 0xCCCCCC, 1, true);
evt.target.graphics.beginFill(0xCCCCCC, 1);
evt.target.graphics.drawRect(0, 0, 114, 23);
evt.target.graphics.endFill();
}
private function buttonReset(evt:ResetButtonEvent):void{
trace("halp");
}
}
}
ResetButtonEvent.as
Code:
package com.mysite.testing{
import flash.events.*;
public class ResetButtonEvent extends Event{
public static const RESET_BUTTON = "resetButton";
public function ResetButtonEvent():void{
super(RESET_BUTTON);
}
}
}
Help With A Tab System
Hey all.. I'm trying to make a tab system and I'm having a problem with clicking on one tab, and then having that tab call a function that resets the appearance of any other tabs that are "on" to "off" Here is basically what I have here:
It all works, but I don't know how to have All instances of the Tabclass respond to the RESET_BUTTON event. I can't seem to figure out how to address the displayList or?????
Thanks in Advance!
C
Tabclass.as
Code:
package com.mysite.testing {
import com.mysite.testing.DisplayContent;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.text.TextFormatAlign;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.events.*;
public class TabClass extends Sprite{
private var _totalTabs:Number;
public function TabClass(pos:Number, totalTabs:Number):void {
_totalTabs = totalTabs;
var dataLoader:Sprite = new Sprite();
dataLoader.name = "dl"+pos;
if(pos==0){
dataLoader.graphics.lineStyle(1, 0xcccccc, 1, true);
dataLoader.graphics.beginFill(0xcccccc, 1);
}
else{
dataLoader.graphics.lineStyle(1, 0xa9a9a9, 1, true);
dataLoader.graphics.beginFill(0xa5a5a5, 1);
}
dataLoader.graphics.drawRect(0, 0, 114, 23);
dataLoader.graphics.endFill();
dataLoader.addEventListener(MouseEvent.CLICK, clickMe);
dataLoader.addEventListener(ResetButtonEvent.RESET_BUTTON, buttonReset);
var boxName:TextField = new TextField();
boxName.text = "Testing";
boxName.width = 110;
boxName.height = 25;
boxName.mouseEnabled = false;
boxName.wordWrap = true;
var boxNameFormat:TextFormat = new TextFormat("Trebuchet MS", 11, 0xffffff, true, null, null, null, null, TextFormatAlign.CENTER);
boxName.setTextFormat(boxNameFormat);
dataLoader.mouseEnabled = true;
dataLoader.buttonMode = true;
trace("TabClass working");
var displayContent:DisplayContent = new DisplayContent(10);
dataLoader.addChild(boxName);
addChild(dataLoader);
}
private function clickMe(evt:MouseEvent):void{
evt.target.dispatchEvent(new ResetButtonEvent());
evt.target.graphics.clear();
evt.target.graphics.lineStyle(2, 0xCCCCCC, 1, true);
evt.target.graphics.beginFill(0xCCCCCC, 1);
evt.target.graphics.drawRect(0, 0, 114, 23);
evt.target.graphics.endFill();
}
private function buttonReset(evt:ResetButtonEvent):void{
trace("halp");
}
}
}
ResetButtonEvent.as
Code:
package com.mysite.testing{
import flash.events.*;
public class ResetButtonEvent extends Event{
public static const RESET_BUTTON = "resetButton";
public function ResetButtonEvent():void{
super(RESET_BUTTON);
}
}
}
ResetButtonEvent.as
Code:
package com.mysite.testing{
import flash.events.*;
public class ResetButtonEvent extends Event{
public static const RESET_BUTTON = "resetButton";
public function ResetButtonEvent():void{
super(RESET_BUTTON);
}
}
}
3d Navigational System
Can someone help with the scripting to make a 3d navigational menu.
Check out http://www.fifthrotation.com to see what I'm talking about. Click on the menu and the 3d navigational system is the 6th button.
I have some sort of idea of how to work something like this out, but I'm looking for suggestions. I'm not that good at math, and I can only assume there are tons of math equations involved.
Thanks,
a..
Navigation System - Help
How did they do that? Check out http://www.greekislandstoronto.com
How did they do the effect that is created whenever you go from one area to another in the site - via the navigation? The images scroll/move depending on what link you choose.
Is that a long clip that has goto and stop actions that correlate to the navigation links????
Any idea how it is done? Any tutorial links to how that is done? Can you supply a tutorial?
I would like to use that effect in my portfolio site.
Score System
Can anyone tell me how to create a score system? I really need one. Thanx
Please Help With My Navigation System
Hi I was wondering if someone could help me with my navigation system? I will try and explain my problem as clearly as possible. I have a navigation bar (which is a Movie Clip in the main timeline). This navigation bar controls the whole site and allows the user to enter certain sections of the site. Now when a user clicks on a section 1, he/she enters the section and is shown a text that fades in. Now is the tricky part, which I am having trouble with. When the user leave that section of the site to go to another section,
e.g. I am in section 1 and I want to go to section 4. So I click on button no.4 in the navigations bar, which then takes me to section 4.
Now when the user leaves a section I would like the text/image that faded in when entering a section to fade out when leaving. Does this seem clear enough. So when you enter a section you have a text or an image fading in, then when you leave a section I need the text or image to fade out. But it has to work for every section in the site,
e.g. I am in section 2 then go to 3
section 1 then go to 3
section 4 then go to 3
section 2 then go to 1
section 3 then go to 2
etc.....
I have thought about it, but I don't have much experience with flash. And having a goto action at the end of the section will not work cause it will only go to one section.
e.g. in the end of section 1 you have a gotoAndPlay ("section 2"); action
This is not the solution because if I want to go to section 4, the script will always send me to section 2.
Navigation system: Button 1, 2, 3, 4
----------------
| [1] [2] [3] [4] |
----------------
Main Timeline:
--[section 1]-----------------------------------------------
-------------[section 2]------------------------------------
------------------------[section 3]-------------------------
-----------------------------------[section 4]--------------
This is a simple diagram. If I am in section 1 I need to be able to jump to any section and have the text or image fade out when I leave section 1, then on entering the next section I need the text or image fade in. And I need this to work for any section I enter.
I am very grateful for any help given.
Flash Akira.
System Clock
How do I use action script to simply change a photo once every hour according to the system clock?
Help With Menu System Please
I have posted an image of what I want my navigation to look like here http://www.fuzzylogik.ws/nav_example.jpg
What i need to make happen:
1.When you click on any box, they all move clockwise to the next position until the item clicked is located in the "hotspot"
2.They don't need to tween between the locations, just move to the next spot until the selected item is in the "hotspot"...kinda like chasing christmas lights
My brain is aching from trying to figure this one out so any help would be greatly appreciated! If you know of a FLA posted in the movies section that does something like this please let me know...I had no luck finding any.
Thanks,
Chris Brixey
[FUZZY.LOGIK]
A Menu System
http://www.nebulouscore.com/examples/NCNavmenu.html (.fla)
http://www.nebulouscore.com/examples/newlevel.as
http://www.nebulouscore.com/examples/CommandEngine.as
http://www.nebulouscore.com/examples/NavMenu.xml
Hardcore code. Enter at your own risk.
System Capabilities
I want to use the system.capabilities object to get the screenresolutionX and screenresolutionY.
Then I want to use these to scale my movie accordingly. Now how is that to be done?
Menu System
Hi,
I'm fairly new to flash, but was wondering if anybody out there with a slower machine could take a look at this for me:
http://www.geocities.com/thurstonis/...type.test.html
It's my first work with prototypes and I'm hoping that it was coded well enough not to bog down on slower computers.
Also, any tips on optimizing the code would be excellent.
Thanks!
Code:
onClipEvent (load) {
menuState = new Array("n", "sr", "fr", "sw", "fw");
currState = menuState[0];
// coordinates for "sr", [0] = x, [1] = y
sideRoofX = new Array(-112.3, -133, -131.1, -136.7, -133.1);
sideRoofY = new Array(-62.5, -79, -69.7, -71.8, -64.5);
frontWallX = new Array(-66.1, 1.4, -101.7, 2.7, -104.0);
frontWallY = new Array(-10.4, -26.8, -8.8, -18, -8.9);
sideWallX = new Array(-98.1, -111.1, -114.6, -112.6, -118.9);
sideWallY = new Array(-6.3, -11.3, 11.2, -12.4, -1.5);
frontRoofX = new Array(-75.4, 3, -117.3, 5.1, -122.5);
frontRoofY = new Array(-62.1, -78.7, -70.3, -71.9, -65);
myButton = function () {
for (i = 0; i < this.myX.length; i++) {
temp = new Object();
temp.x = this.myX[ i ];
temp.y = this.myY[ i ];
_parent.localToGlobal(temp);
this._parent.globalToLocal(temp);
this.myX[ i ] = temp.x;
this.myY[ i ] = temp.y;
}
this.gotoAndStop(menuState[myState]);
this._x = this.myX[_global.currFrame];
this._y = this.myY[_global.currFrame];
this.myState = _global.currFrame;
};
myButton.prototype = new MovieClip();
myButton.prototype.onEnterFrame = function() {
if (_global.hideButtons) {
this._visible = false;
}else{
this._visible = true;
}
if (this.myState != _global.currFrame) {
this.myState = _global.currFrame;
if (this.over) {
this.gotoAndStop(menuState[this.myState] + 1);
} else {
this.gotoAndStop(menuState[this.myState]);
}
this._x = this.myX[_global.currFrame];
this._y = this.myY[_global.currFrame];
}
};
myButton.prototype.onRollOver = function() {
this.over = true;
this.gotoAndStop(menuState[this.myState] + 1);
_parent.gotoAndPlay(menuState[_global.currFrame] + "-" + menuState[this.myName]);
};
myButton.prototype.onRollOut = function() {
this.over = false;
this.gotoAndStop(menuState[this.myState]);
//_parent.gotoAndPlay(menuState[_global.currFrame] + "-n");
};
myButton.prototype.onRelease = function() {
trace("I am " + this);
trace("My parent is " + this._parent);
trace("released");
trace("x=" + this._x);
trace("y=" + this._y);
trace("My X should be" + this.myX[_global.currFrame]);
trace("My Y should be" + this.myY[_global.currFrame]);
};
Object.registerClass("sideRoof", myButton);
Object.registerClass("frontWall", myButton);
Object.registerClass("sideWall", myButton);
Object.registerClass("frontRoof", myButton);
attachMovie("sideRoof", "srBUT", 100, {myName:1, myX:sideRoofX, myY:sideRoofY});
attachMovie("frontWall", "fwBUT", 101, {myName:4, myX:frontWallX, myY:frontWallY});
attachMovie("sideWall", "swBUT", 102, {myName:3, myX:sideWallX, myY:sideWallY});
attachMovie("frontRoof", "frBUT", 103, {myName:2, myX:frontRoofX, myY:frontRoofY});
}
Archiving System
hi
i am making an archiving system soon.
does anyone know where there a tuts or .fla's for it?
does anyone know much about it or advice
i could do with some help
cheers
System.properties
Has anybody out there had some experience with the new system.properties object?
Navigation System
hey,
im trying to create as navigation in which there are 4 buttons on the left, and a button on the right.
the button on the right is telling you where u r.
when u click on one of the buttons of the left, it plays a short movie of the button being moved over to the right, over the previous button on the right. The space where the button on the left was fades to show the button that was on the right.
heres an example: your at the home page and it says "home" on the right. The buttons on the left say "links", "pharses","poetry" an "jokes"
when u click on "links" a movie shows the links button being moved over the "home" button covering it.
where the "links" button was the home button fades in.
i want it to work for all of the buttons.
what would the actionscript be????
im very new at actionscript and have no idea what i would write
help
thanx a lot
PJ
|