
Welcome Guest
|
|
|
#1
|
|||
|
|||
|
I need to make a counter on my webpage is it possible to make it in FLash. Can anyone tell me how to do it? Please...
|
|
#2
|
|||
|
|||
|
Hi Kropsi,
Yes this is possible , but U will need some serverside scripting to achieve this (CGI, Perl or PHP....etc) As I don't know what languages U know I can't advise much. Do U know any ? http://www.php.net is a useful site. Regards~ ~Av~ |
|
#3
|
|||
|
|||
|
No, I don't know any languages that is the problem. I will try to find out how to do it anyway. Need to learn one of those languages then. I was recommended perl, what do you think?
|
|
#4
|
|||
|
|||
|
perl is good, i know it's useful whenever im making forms of some sort. also, asp is good to know. good luck
|
|
#5
|
|||
|
|||
|
Hey again,
Perl is a very powerful and versitile language although can be difficult to learn (thats my own opinion) If U have no scripting experiance I suggest PHP (again my opinion as this is how I achieved my counter) there are many good beginners books for PHP (including Beginning PHP4) all listed at FM's <a href="http://flashmove.com/books/">BOOKS</a> section. The web site I previously posted also has many tutorials and examples for the new-to-php. As far as the Flash side is concerned all U need is a Dynamic textfield and a LoadvariablesNum(); command. Hope this helps~ Good luck~ ~Av~ |
|
#6
|
||||
|
||||
|
agree to av, php is easy if u till know only knew FAS.
perl an php both have their advantages and disadvantages. perl knows regular expressions, php knows the swf format and is able to generate swf files on demand. but everything now depends on the system it later is going to run (the servers OS) hopefully u have a unix based server then i would suggest php for doing the job. asp may b easy to learn, but 1. u got to buy it php and perl r free. 2. asp is no language it uses vbscript and vbscript is a scripting language so not as mighty as the above mentioned. 3. asp is a microsoft product. 4. prevent microsoft at server side, they first should try building stable OS and care abit more about security.
__________________
--- if TCPA is the answer, how stupid then was the question? There is a diffrence in knowing the path and walking the path. if u found this thread usefull, then rate it. this way we all save a lot of time, searching for the good ones. |
|
#7
|
|||
|
|||
|
Thank you very much!
Now I think I got enough information on this subject. Need to find out which is the best and easiest language for me.
|
|
#8
|
||||
|
||||
|
definitly for a counter it's php for u just need one php page. just use the html page u already have, add a javascriptarea to it and add identifiers to yar object and embed tags
only containing one function :=brackets function tellvisitornumber(){ document.swfindentifier.setVariable("visitors", :?php echo visitor ?: ); } and place a code at the bginning of the page opening a textfile reading the first line (looks like visitor=numericvalue) increasing visitor and saving the file again. thats all. look php.net for exact syntax but thats the way it works. when now flash wants the number it just has to call the function using geturl"javascript:functionname()"; and the visitors variable in the flashfilm is set to the value.
__________________
--- if TCPA is the answer, how stupid then was the question? There is a diffrence in knowing the path and walking the path. if u found this thread usefull, then rate it. this way we all save a lot of time, searching for the good ones. |
|
#9
|
|||
|
|||
|
I tried to make this like you said:
In my counter.htm file I wrote this function: function tellvisitornumber(){ document.swfindentifier.setVariable("visitors", (?php echo visitor ?) ); } In the first frame of my counter.fla I added function: count = loadVariablesNum ("javascript:functionname()", 0); in the same frame I added a dynamic text with variable: count But it doesn’t work, I think that code, you suggested, doesn’t work. |
|
#10
|
|||
|
|||
|
I think this is totally wrong. Tell me please what I did wrong. I couldn’t find out where to place geturl function and after I thought that the right thing was to use loadvariable function.
Is visitor the variable, because I tried to use it instead of count variable, but it didn’t work either. |
|
#11
|
|||
|
|||
|
I'm not sure if I've been learning PHP the correct way now but this is how I did it .........
Code:
[?
//hit counter
$fp = fopen("counter.dat", "r");
$counter = fgets($fp, 4096);
fclose($fp);
$counter++;
echo "c=" . $counter;
$fp = fopen("counter.dat", "w");
fwrite($fp, $counter);
fclose($fp);
?]Basically the above code is triggered by the Flash command [loadVariablesNum("cgi-bin/counter.php3");] then the PHP script takes over and opens a file called "counter.dat" and 'reads' (hence the "r" in 'fopen("counter.dat", "r");') the content, then incriments the number (simliar to Flash) then opens the previous file again and 'writes' (hence the "w" in the fopen() command)the new (incrimented) number to it. "C=" echos the value back to the Flash content (to the dynamic textfield called 'c') and so on ........ This is a very baisc and Quick explaination of how to do it, sorry if its so vague. Hope this helps~ (I'm expecting more questions )~Av~ |
|
#12
|
||||
|
||||
|
lol u both r talking about completely diffrent stages of development
![]() kropsi, first visit the mm technotes to read about indentifiers. after u know set one instead of my swfindentifier. then bevor we r going to make it run at server side put yar nose into the manual before u just keep trying. ![]() anyvariable = loadvariable... is crap and can't work. why can'T it work? remember that the flash time line is some sort of fourth dimension? when doing an loadvars or loadmovie command i one keyframe when do u think is the data then loaded, instantly? WRONG just think of some 9600 k modems even if the data is already embeded at the html page BTW LEARN HTML AND JAVASCRIPT if u want to use it and want to extend flashs possibilities. the data still needs some time also reread the manual for data exchange, u can'T assign the loaded data to just one variable. the data is sent and recieved using urlencode -> look at the manual or w3c or general internet protocols. so the data somewhen is going to b available in the flash film, just make sure u know when. btw there is a guestbook tutorial somewhere here around there r hundreds of lines of code worth analysing dealing with that subject. and for the first step just fake the data that later is going to be placed at the script by php. and please, first know what u do then try it and if it still doesn't work then post a question, but we won't do the coding for ya. (not unpayed) if u never dealed with coding, eithr learn it fast or leave it to others.
__________________
--- if TCPA is the answer, how stupid then was the question? There is a diffrence in knowing the path and walking the path. if u found this thread usefull, then rate it. this way we all save a lot of time, searching for the good ones. |
|
#13
|
|||
|
|||
|
I am sorry I am a newbie in programming part of the question, and I need to start somewhere. When you gave me your "possible" code, I tried of course to find out how it work and made my mistakes as you saw, but you just don't need to help me if you don't want. I am trying to study by myself of course by reading others codes, because I don't have any experience at all or literature about php, javascript etc. I don't have any friends some have the same interests as me, that is why I am trying to find some people who are really good at designing, programming and stuff like that, so I can learn something from them and help them when I will be qualified enough.
Anyway I found a fine example of flash counter: http://phpklik.dhs.org/fla Download example here: http://phpklik.dhs.org/fla/flacounter.zip I hope it will be useful for those who needed help with making theirs flashcounters. |
|
#14
|
||||
|
||||
|
Quote:
the only really thing that goes on my nerves is and please don'T understand me false here, some guys r coming around asking some things u thought u pointed them the right direction, and afterwards u realize that the information u provided was already one step ahead. the problem is we just won't have time to explain all the basics. otherwise i could post a book here. but good to know that u found what u have been searching for.
__________________
--- if TCPA is the answer, how stupid then was the question? There is a diffrence in knowing the path and walking the path. if u found this thread usefull, then rate it. this way we all save a lot of time, searching for the good ones. |
|
#15
|
|||
|
|||
|
I hope you didn't misunderstand me. I enjoyed our dialog whole the way to the part where you began to talk about money
<blockquote><FONT face="verdana,arial,helvetica" size="1" >quote:</font><hr>and please, first know what u do then try it and if it still doesn't work then post a question, but we won't do the coding for ya. (not unpayed) <hr></blockquote> but anyway I would like to say thank you for helping me out. I feel me unwise concerning the programming yet. I hope the example I found was good, so if somebody else will use it, they won't regret. What do you think of it Gargoyle? |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reminder: Adobe needs users for Flash video & button studies: get an Amazon gift card | Jay_Armstrong | Flash CS4 |
0 | 08-18-2009 12:55 PM |
| Flash Counter?? | mc1060 | Actionscript 2.0 |
3 | 05-11-2009 01:12 AM |
| have mouse events pass straight through a flash movie? | johnyboy | General Flash | 12 | 09-08-2006 11:32 PM |
| Flix 8 for Flash 8 is available | on2com | Flash Video |
1 | 09-27-2005 09:54 PM |
| Left side of assignment operator must be variable or property. | mancroft | Flash MX ActionScript |
2 | 06-29-2003 10:50 PM |

Other Programming



Now I think I got enough information on this subject. Need to find out which is the best and easiest language for me.
)
