LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




ReplyREPLY THREAD
 
Thread Tools Display Modes
  #1  
Old 04-16-2001, 04:16 PM
Kropsi Kropsi is offline
Registered User
 
Join Date: Mar 2001
Posts: 47
Rep Power: 0
Kropsi is on a distinguished road
Smile

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...
Reply With Quote
  #2  
Old 04-16-2001, 10:11 PM
Av Av is offline

Super Moderator
 
Join Date: Aug 2000
Location: England
Posts: 960
Rep Power: 13
Av has disabled reputation
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~
__________________
Remember, before you post, SEARCH

old F5 tuts here

av@flashmove.com
Reply With Quote
  #3  
Old 04-17-2001, 05:16 AM
Kropsi Kropsi is offline
Registered User
 
Join Date: Mar 2001
Posts: 47
Rep Power: 0
Kropsi is on a distinguished road
Shy

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?
Reply With Quote
  #4  
Old 04-17-2001, 01:38 PM
OuTbReAk OuTbReAk is offline
Registered User
 
Join Date: Feb 2001
Posts: 173
Rep Power: 13
OuTbReAk is on a distinguished road
perl is good, i know it's useful whenever im making forms of some sort. also, asp is good to know. good luck
Reply With Quote
  #5  
Old 04-17-2001, 02:27 PM
Av Av is offline

Super Moderator
 
Join Date: Aug 2000
Location: England
Posts: 960
Rep Power: 13
Av has disabled reputation
Smile

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~
__________________
Remember, before you post, SEARCH

old F5 tuts here

av@flashmove.com
Reply With Quote
  #6  
Old 04-17-2001, 05:27 PM
Gargoyle's Avatar
Gargoyle Gargoyle is offline
Moderator
 
Join Date: May 2000
Location: germany
Posts: 3,471
Rep Power: 17
Gargoyle is on a distinguished road
Rolleyes

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.

Reply With Quote
  #7  
Old 04-17-2001, 07:32 PM
Kropsi Kropsi is offline
Registered User
 
Join Date: Mar 2001
Posts: 47
Rep Power: 0
Kropsi is on a distinguished road
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.
Reply With Quote
  #8  
Old 04-18-2001, 01:12 PM
Gargoyle's Avatar
Gargoyle Gargoyle is offline
Moderator
 
Join Date: May 2000
Location: germany
Posts: 3,471
Rep Power: 17
Gargoyle is on a distinguished road
Rolleyes

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.

Reply With Quote
  #9  
Old 04-18-2001, 04:00 PM
Kropsi Kropsi is offline
Registered User
 
Join Date: Mar 2001
Posts: 47
Rep Power: 0
Kropsi is on a distinguished road
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.
Reply With Quote
  #10  
Old 04-18-2001, 04:18 PM
Kropsi Kropsi is offline
Registered User
 
Join Date: Mar 2001
Posts: 47
Rep Power: 0
Kropsi is on a distinguished road
Rolleyes

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.

Reply With Quote
  #11  
Old 04-19-2001, 12:12 AM
Av Av is offline

Super Moderator
 
Join Date: Aug 2000
Location: England
Posts: 960
Rep Power: 13
Av has disabled reputation
Smile

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);
?]
The above is a PHP script located in a folder (usually the cgi-bin) with CHMOD 777. (U can write this code directly into notepad or something similar and save as *.php)
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~
__________________
Remember, before you post, SEARCH

old F5 tuts here

av@flashmove.com
Reply With Quote
  #12  
Old 04-19-2001, 11:35 AM
Gargoyle's Avatar
Gargoyle Gargoyle is offline
Moderator
 
Join Date: May 2000
Location: germany
Posts: 3,471
Rep Power: 17
Gargoyle is on a distinguished road
Rolleyes

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.

Reply With Quote
  #13  
Old 04-19-2001, 12:13 PM
Kropsi Kropsi is offline
Registered User
 
Join Date: Mar 2001
Posts: 47
Rep Power: 0
Kropsi is on a distinguished road
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.
Reply With Quote
  #14  
Old 04-19-2001, 03:30 PM
Gargoyle's Avatar
Gargoyle Gargoyle is offline
Moderator
 
Join Date: May 2000
Location: germany
Posts: 3,471
Rep Power: 17
Gargoyle is on a distinguished road
Rolleyes

Quote:
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.
err hopefully this is not really yar impression u have now.
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.

Reply With Quote
  #15  
Old 04-19-2001, 04:22 PM
Kropsi Kropsi is offline
Registered User
 
Join Date: Mar 2001
Posts: 47
Rep Power: 0
Kropsi is on a distinguished road
Big Grin

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?
Reply With Quote
ReplyREPLY THREAD


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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




All times are GMT. The time now is 05:21 AM.