Jump to content
xisto Community

andrewsmithy

Members
  • Content Count

    21
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by andrewsmithy

  1. You could have a page repeatedly update by adding a meta-refresh. If you place the following tag in the <head> tag: <meta http-equiv="refresh" content="numberOfSeconds" /> It will refresh every numberOfSeconds. This is a way show users a constantly updating page, although AJAX would be a better way to do that.
  2. Formatting in PHP can be a very hard to re-trace, with code output that looks very messy. Here are a couple of helpful ways to make your PHP code look like a neatly formatting HTML page, that is easy to debug and read. The problem with using PHP is that the script and the HTML code become very unorganized and cluttered if you don't plan your pages properly. One very good technique that I use, I like to call the "header/footer" technique. It's very simple. You make a .html file or .php that simply has the html head></head> tag in it. You can use the same file for all of your pages on your site, without having to re-write it in very page. Here's how it works. First, create a file called header.php, like this: <html><head><title>My Website</title></head><body> This is your header file. Now, you can include it in all your PHP pages. You do this by a simple include directive, that tells the PHP processor to include the specified resource. Here is an example PHP script: <?phpinclude "header.php"; // This line include the header fileecho 'This is page 1.';?> If you check this page out, you will see the the header has been included into the output. You could even make a footer that includes copyright information, and the closing tags. You would just include it after your generated content. Now here's where it gets fun. You can dynamically set the title and other attributes, without having to modify the header for every PHP script. That's what PHP is all about! Dynamically generated content. Ok we need to modify our header.php script to look like this: <html><head><title><?php if (isset($title)) { echo $title; } else { echo "Default Title!"; } ?></title></head><body> We changed it to check for the variable $title and if it was set, display it. Otherwise it would display "Default Title!". Back in the php page, we can set the $title variable, of course, before we include the header.php file. It will look somewhat like this: <?php $title = 'Page 1\'s Title!'; include "header.php"; // rest of the page... include "footer.php"; ?> So, that's it. Go start coding some php!
  3. FORENOTE: I did this as my research paper for an English class, and I thought I would post it here. It's quite long (6 pages), but may be helpful for you here. I don't know. Reply if you like it.Andrew SmithMrs. Kim BaumgaertelHigh School Composition19 April 2005Introduction to Web Services Technology continues to advance, sometimes in revolutionary breakthroughs or in seemingly minor evolutions. The creation of the internet in the 1990s allowed people to access information from a wealth of resources, and allowed businesses to create their identity. This new technology matured, as did several demands. Gone are the days of technological ?toys? and innovation; they have been replaced with standards of function and use. Because businesses found it difficult to communicate with each other and themselves due to different systems, servers, operating systems, or applications, a standard way of communication was needed to keep together the seemingly fragile environments. In 2000, a technology known as Web services was created to keep business connections from falling apart, and provide better communication. ?Web services started as a vision of ?web applications? that could find each other on the Internet, establish communication channels, and exchange information and services without human intervention.? (Nakhimovsky/Myers 3) There are many definitions for a Web service, but generally speaking, a Web service is technically defined as a software application that can be accessed remotely using different XML-based languages. A Web service is normally identified by a URL (Uniform Resource Locator), a lot like a website. The difference lies in the content. Web service servers and clients send an XML document that complies to the rules of the SOAP specification, where a standard website sends a regular HTML document. A SOAP message can contain a call to a method along with any parameters that might be needed. A SOAP message can also contain a header in which extra processing parameters can be sent to the service. Web services are not a completely new technology, but rather an association of components that work together to accomplish the task of communication. It doesn?t matter what kind of computer is sending the message or what operating system it is running. It doesn?t matter where in the world the client is sending the message from, what language the software is written in. It also doesn?t matter what type of SOAP processor is running on the server. In essence, Web services are the ultimate answer in computing. Every software application can potentially talk to every other software application in the world, regardless of the old boundaries of location, operating system, language, protocol, and so on. Web services still have a long way to go. ?Web Services are still more like a movement than a mature technology.? (Nakhimovsky/Myers xix) Web services are a faster approach to system communication development. Instead of re-writing a whole new system, Web services allow the developer to use existing components. The components, known as legacy systems, are simply code that has already been written, tested, and has been found reliable. Web service systems can be developed faster by using a wide variety of programming and rapid development tools. Since any programming language can be used, current programmers can easily adopt the Web service approach by using previously learned skills or legacy systems. Entirely different systems can communicate seamlessly. Web services also offer a cheaper way to offer services. Because Web services can be created in any programming language, and because they are reusable, new developers do not have to be hired to build Web services. Web services provide businesses with lower operational costs in many ways. First, web services use the Internet, which is much cheaper that a LAN (Local Area Network) based network. Web services can be used for remote system management; being able to fix problems without having to be at the computer with problems. However this is just the beginning of the glory of Web services. Web services fit perfectly into today?s business world. Because Web services are so universally adaptive, businesses can interconnect with other businesses without having to make significant changes to either system. Web services integrate better with customers as well. Web services allow customers to access business information, order and ship products because the Web Service architecture is inter-woven into their systems. For example, if a store ran out of carrots, the store could easily order more carrots through the Web services of the carrot business. Web services provide low-cost electronic data interchange between customers and vendors. Web services can allow for remote status reports on shipping or progress from any organization, night or day. Also, Web services are being expanded onto PDAs (Personal Digital Assistant), which can allow for service people to be dispatched using Just-in-time planning instead of site-to-site. A client can request a physical service, and the workers can immediately see that a new job has been added to their list, instead of having a planned workday. Web services seem like the best technology ever, but many inter-communication issues still exist, and not all businesses have migrated to the Web service approach. After looking at the advantages of Web services, one must also look at the disadvantages of Web services. As mentioned before, Web services are more of a movement than a mature technology. ?Because web services are a relatively young technology, the standards are evolving rapidly. Applications built on one version of the specification can quickly be outdated. There is a general lack of standards in several areas such as authentication, security, and billing/contracts. Authentication is not yet implemented in the Web service standards, and is left to the web services to handle. Security and privacy are poor in the Web service architecture. There are several security measures that may be taken by the Web service, such as data transfer over SSL (Secure Sockets Layer) which encrypts all the data, secure and insecure. HTTP is insecure, allowing anyone to intercept requests from the client and responses from the server. However, security is not the only problem. Because Web services communicate over internet, this presents several problems. First, no site is available 100% of the time, and without the ability to contact the Web service on the site, Web services cannot interact. HTTP, with all its advantages, still has faults that affect Web services. It is very transactional in nature, and time is wasted creating and terminating connections, causing it to be slow. It is built to handle hundreds of request per second, instead of a longer, meaningful connection with a Web service. HTTP is not a reliable protocol, and can?t guarantee a request or response. There is no ?rock-solid? evidence that a transaction has taken place. There are performance issues as the data has to be decrypted (if encrypted), parsed (read), processed, and encoded to send to the client. Sometimes a Web service will not always match a specific client, because different clients need specialized information. Also Web service methods must stay the same, as clients rely on these methods. Beyond all of these pitfalls and disadvantages, Web services provide a very universal way to communicate. Web services offer some advantages when compared to three types of current systems: stub/skeleton systems, screen scrapers, and HTTP transactional systems. Stub/Skeleton based systems are communication systems that are ?meant to provide programmatic access to some form of remote service as though it was a local entity.? (Potts/Kopack 44) The ?stub? is the code on the client side, and the ?skeleton? is the code on the server?s side. They typically can handle a higher number of requests because the connection is persistent; however, interoperability is much less between these systems. Some popular solutions that use this architecture are CORBA, RMI, and DCOM. Web services offer a greater amount of interoperability than stub/skeleton based systems. Screen scrapers are client-side applications that make use of an existing interface such as a Web browsers or mainframe terminal. They push data into an interface, and then read (or scrape) the returned data off of the interface and convert it into something that the client application needs. ?Screen scrapers aren?t pretty.? (Potts/Kopack 53) They rely on an interface, and if it changes, they have to be re-written. Lastly, are HTTP transactional based systems. These run today?s main web applications. They are based on a client/server architecture with a typically larger client to server ratio. They communicate over standard ports (TCP 80, 81), which most networks leave open. Some common HTTP transactional systems are CGI (Common Gateway Interface), Servlets/JSP (Java Server Pages), ASP (Active Server Pages), and PHP (Hypertext Pre-Processor). With the advantages of HTTP transactional systems, there are several issues including, performance issues, lack of a directory service, and no true error handling.The amazing part is that these systems can be converted to Web services fairly easily. After looking at what Web services are, how they compare to other technologies, it is time to look at the components that make up Web services. As stated before, Web services are individual technologies that work together to effectively communicate between each other. The major components of the Web service architecture are HTTP/1.1, Cookies, SOAP 1.1, UDDI 2.04, WSDL 1.1, XML 1.0, and XML Schema. Most of these technologies, including the Web service specification, are maintained by the World Wide Web Consortium (W3C). The W3C looks for the best in standards, not vendor-specific ideas. Each of these components plays a vital and different part in the Web service architecture. To communicate over the internet, several different protocols may be used. Near the base of all communication is TCP/IP (Transmission Control Protocol / Internet Protocol). TCP/IP is a lower level set of protocols for the transmission of data across a network. TCP/IP has more overhead information than other protocols such as UDP (User Datagram Protocol), but has more reliable delivery. Built upon TCP/IP are other protocols such as HTTP, SMTP, FTP, Jabber, etc. HTTP, or Hypertext Transfer Protocol, was built in the early 1990?s, and is the workhorse of the web. HTTP facilitates the transfer of requests for a browser to a Web server. In HTTP, communications are established through a simple ?handshake? mechanism. The client makes a connection to the server, the server sends the socket to connect on, the client requests data, the server processes the request and sends the result back, the client acknowledges the data, and the server closes the connection. SOAP makes great use of HTTP; however, HTTP is not required for SOAP and Web services. HTTP is by far the largest used protocol for Web services. Web services can also use FTP, or File Transfer Protocol, which is designed for moving files from one computer to another. Another protocol that is used for Web services is SMTP (Simple Mail Transport Protocol) which is used for sending email. SMTP works by checking if the message that is being sent, is being sent to an address on its server. If the address is not on it, SMTP simply sends it on to another server which does the same thing, until the message reaches the right server. SMTP takes much longer than HTTP or FTP, and the messages may not even reach their destination. Furthermore, it is easy to eavesdrop on the messages along the way. However, SMTP is perfect for sending a message to a client that is not available all the time, or publish/subscribe types of Web services. Jabber is a protocol that is made for instant messaging, and communicates with most instant messaging services and programs. Jabber is the newest protocol of the protocols looked at. All of these protocols have strengths and weaknesses, but Web services can use any of the afore mentioned protocols. It is up to the Web service developer to choose the protocol that would work the best for the Web service. Another key component and cornerstone of Web services is XML. XML stands for Extensible Markup Language and is more of a meta-language in that it is a language that is used to create grammars such as WSDL and SOAP. XML describes data in a way that is human and computer readable. It is a tag-oriented language, much like HTML or SGML. XML documents must be written according to the xml grammar rules, or the XML parser will give an error. A document that follows these rules is considered to be ?well-formed.? There are several components to XML. There is the XML document, the XML Parser, DTDs, XML schemas, and namespaces. The XML parser produces a program-readable version of the document. The XML schemas provide a powerful way to describe the structure of XML documents; they are more powerful than DTDs (Document Type Definition), and have made DTDs obsolete. Schemas specify elements, their attributes, their range of values, and their data types. The namespaces are a prefix to the tag name separated by a colon, and a declaration of that namespace?s unique identifier, which is typically a URL. They prevent a XML document from having two different tags with the same names. All of these components work together through the document?s usage. XML provides a powerful way to describe and use data. This makes it ideal for data transfer between Web services. XML is not enough to accurately describe a message for transfer between Web services. In 2000, the SOAP specification became a standard. It is not a product that was created by a vendor, but rather a document that describes the characteristics of a piece of software. SOAP used to stand for Simple Object Access Protocol, but is now considered a name. It is a XML-based language, with a tighter specification for the contents. SOAP is much less than other alternatives such as DCOM or CORBA, but it has a higher level of abstraction so it can be used on any operating system and any programming language. ?SOAP does not specify what data can be moved or what function calls can take place over it.? (Potts/Kopack 126) It is simply an XML grammar that defines how to send and receive messages. A SOAP message consists of an envelope that contains an optional header and a body. The header contains instructions on how to process the message, and the body is a payload that contains the method call. SOAP is used by Web services to send data and method call between the client and the server. It is a universal way to communicate with any Web service, making the Web service approach much more appealing. In all this Web services are still missing a component. It is easy to communicate with a Web service through the protocols and data formats mentioned above, but not if the client has no knowledge of the Web service. The question is posed. How does a potential client learn about the Web service? Up to this point, the answer might be through HTML documentation or other. However there is a much better standard known as WSDL, or Web Service Description Language. WSDL is an xml-based language that describes items such as what methods may be called, parameters for these methods, response types, protocols used to connect and receive data from the Web service, the URL of the Web service, etc. A programmer can write a client solely off of this document. Now, programs and IDEs (Integrated Development Environments) can automatically generate a WSDL document for a Web Service, and some can even generate a simple client from the WSDL descriptor. WSDL answers the question of how to communicate with the Web service, and is another advantage to Web services. Lastly, there is a need to find a Web service on the Internet. Instead of searching for hours, trying to find the types of Web services needed, there is a solution called UDDI. UDDI, or Universal Description, Discovery, and Integration, is a special type of registry that lists web services that a client might potentially be interested in. The potential customer can search the registry, browse the results, find a potential service, look at its description and WSDL, and use that Web service. Developers publish their Web service information to the registries, and then receive customers. There are three types of registries: public, private, and restricted. Public registries are available to everyone. Private registries exist behind a firewall, and usually are a company?s registry of web services. Restricted registries are only accessible to certain organizations, such as partnerships. UDDI completes the Web service puzzle by allowing clients to find Web services that they can consume, or use. Web services will be the answer to many of today?s communication and computing problems. They offer ease of use, universal information exchange, new business models, and more. As the technologies that drive Web services are molded into a more interoperable system, all the prior barriers will be removed. Web services are still not a mature technology. Even now, in 2005, standard are being revised and built to further enhance the Web service architecture. However, the technology still advances. New ideas as well as solutions to common Web service problems are being created. Web services, although not as much of a revolution as the creation of the Internet, are still a very limitless and powerful innovation. The future of Web services is bright.
  4. andrewsmithy

    Java + Php

    There is a way to mesh java code in with php, through a php extension, but this may not be what you're looking for. This is a link to php.net's site on the java<->php integration. http://forums.xisto.com/no_longer_exists/ Check this out and see if its what you are looking for. Here is a quote from the page: Maybe this is what you are looking for, well later.
  5. I wrote that thank you very much. yes, cuz i think their awesome!
  6. ?Anything could happen. You have to be prepared.?- Seth Hettena, Washington Post journalistThe special operation Navy SEAL is one of the hardest physical and mental training in the American military. Becoming a SEAL is very challenging and requires skills in all areas. The SEALs are often called ?quiet professionals? because they are able to perform their job without fault and in secret. They have to be so secret that they can?t even discuss their duties with their family! SEAL commander Torie Clark made the comment that emphasizes this secret duty quite well: ?We don?t talk about? details for obvious reasons: it puts peoples? lives at risk, and it gives the bad guys a heads up as to what we?re doing.? But when these special operations team first came into existence, they weren?t first-class infantry. The Sea, Air, and Land (SEAL) team has been going on for nearly fifty years now. They were first known as the Naval Combat Demolition Units, or NCDU. The volunteered NCDUs were made for specifically amphibious landings. Their training was difficult, but nothing like the training of the present. They soon merged into what was called the Underwater Demolition Teams. The UDTs were formed during World War II, in September of 1950. Their job was to secretly destroy underwater forces, or any other threat. After they contributed in the Korean War, John F. Kennedy decided he wanted something more. When troops would march down the shores of enemy territory, they would receive heavy fire and massive troops were killed. The president then organized the US Navy SEALs to fix this fiasco. They would be a highly trained troop that could do everything from diving to ground combat. Now he could take these forces and destroy any major threat secretly, therefore saving many lives of light infantry. During the Vietnam War, their success in these new Sea, Air, and Land special ops troops proved their capability toward their country. During the war, they noticed a significant change in combat success. But to be recruited on this team is not an easy task to undertake. Today, a recruit has to be extremely fit and mentally tough. When they receive a recruit that looks fit verses a small man with confidence that strives to do his best, the smaller one is typically the one who makes it through. Since the team is part of the Navy he has to first enlist in the Navy. Next, they must be under 28 years of age, have required eyesight ability, and do a number of physical fitness tests. But that?s only the very beginning. ?By the time you?ve gone through three-fourths of it, every fiber of your muscles are burning, and you still have another quarter to go, and it?s all through sand,? says Navy SEAL Hans Halberstandt. The first thing the SEALs realize is that they are risk takers; therefore they have to be prepared for anything. Their basic job is to get to their destination as quick as possible, leave no trace, and get out. They do their job well. They train hard! The instructors make the courses as real life as possible. But, physical fitness isn?t the only thing the gets them through, mental fitness is far more important. They train hard because anything could happen. The SEALs official website put it like so: ?SEAL training is extremely demanding, both mentally and physically, and produces the world?s best maritime warriors.? Basic Underwater Demolition/SEAL, or BUD/S, is the basic training a SEAL must go through before becoming a SEAL. This training consists of five sections, adding up to approximately thirty three weeks. Indoctrination is the first part of this fitness training, and lasts about five weeks. This is only the beginning of the great task that lies before them. The reason for this stage is to give the recruits in idea of what their required to do. Preparations are made during this time, testing their courage, strength, and determination. The First Phase, or Basic Conditioning, is the second major aspect of the BUD/S training. During this eight week period, the recruits will begin their hardest fitness and mental tests during BUD/S training. Teamwork, physical conditioning, swimming, and running are the most concentrated items of the phase. During the first five weeks, they learn how to save lives and tie knots, and surf passage in small inflatable boats (surfing with rubber boats). Weekly they participate in four mile long runs with heavy boots and clothing on, and two mile long swims in the ice cold ocean. Their runs are mostly all in soft sand and have to pass a certain timed limit. As each week progresses, they get tougher and tougher. They are constantly training, running, climbing, or swimming. If a recruit doesn?t make it through a course, he is ordered to jump into the ocean, and dry off in the sand. They are required to swim fifty yards underwater; often they need to be revived after passing out. After they pass the underwater test, they tie their hands and feet with twine and are placed in water over their heads, forcing them to bob up and down. This is called drown proofing, after a tragic death of a soldier whom hands and feet were bound and released into a waterway. Another way of trying to prevent drowning is to build up immunity against hypothermia. Surf torture is an often done test that the whole team is associated in. The whole team wades out in the ice cold water and sits down. After time, the heat flushes out of the body causing intense shivering. But the worst is yet to come. On the fourth week of the First Phase, there is an intense training called Hell Week. Hell Week is the hardest week any recruit will ever go through. They are constantly training. The whole week they get a total of four hours of sleep. 400 ? 600 pounds logs are carried together, cold, long swims are accomplished, and hefty runs are completed. The members get so tired and worn out they hallucinate, throw up, and sleepwalk. But not everyone makes it through this dreadful week. This week is what really challenges the recruits of how much they are willing to sacrifice in order to become a SEAL. The most drop outs occur during Hell Week. At the end of the week, they are required to write down why they want to become a Navy SEAL; after it?s over, the paper is handed back to them. But since they were so tired when they wrote it, they don?t make any sense, therefore reminding them how hard it was during Hell Week. The trainers test them to their limits. And the amazing thing is: the trainers also do the same thing! After Hell Week each recruit gains an enormous amount of respect from their trainers and commanders. The Second Phase requires the men to run faster, swim faster, and complete obstacle courses faster. This is what makes the SEALs separate than other special ops teams. This phase is often called the diving phase, lasting approximately seven weeks. As the name states, here they focus on diving. The divers will first begin in a pool. After simple diving becomes second nature to them, they begin to start diving in the ocean. The ocean is nothing like a pool. You have current, temperature, and darkness to consider. You have to remember that ocean isn?t still. Massive waves and thousands of pounds of water are constantly shifting. And it is not warm in the ocean. The average temperature, in California, is below 50 degrees Fahrenheit. It?s also very dark and deep in the ocean, making it very hard to see what you?re doing. Recruits are also trained to fight underwater during this time. They are taught how to tie knots underneath the water, and working with underwater units. This skill is really what the SEALs are known for, and is definitely an area of expertise. ?Mistakes made when working with explosives only happen once,? writes SEAL trainer Fernbough. The next course the SEALs undertake is the most dangerous out of their training. The Third Phase focuses on land fighting and explosives, and lasts nine weeks. As Fernbough stated, accidents only happen once while working with explosive equipment. But just because they are working on ground combat, explosives, and firearms doesn?t mean that they don?t complete their daily exercises. The recruits are even required to do everything faster and faster. The last four months of training, they leave the men on an island and show their skills that they learned during training. The last stage of BUD/S is the air jumps. These parachute dives are critical to a SEAL to get in a territory quickly and sufficiently. But when you?re 23,000 feet up above the ground, the air is extremely thin, and there is a very little amount of oxygen. The divers will breathe pure oxygen while in the plane so they won?t suffocate. The first major jump is called a Halo Jump. This high altitude jump is one of the hardest jumps ever. The men jump out at about 23,000 ft and hit the ground in almost two minutes. Halo stands for High Altitude, Low Opening. By the time you open your shoot and it catches you, you?re about 34 feet from the ground! Now that the ?official? training is done, the real work begins. A SEAL never stops learning. Being a SEAL is a 100% commitment. Now, you might be wondering; does every recruit make it on a team? No, actually only about one fourth of them become a SEAL. And if you didn?t make it, you do it all over again. But for the successors, they move on. Their first mission is the most critical for their career. If the SEAL at any time is in bad behavior, he is immediately kicked of the team. No excuses. That might lead you to the conclusion that not many SEALs exist. Out of the whole US country there?s only about 2,000 of them. But SEALs are very vital to this country, even though there?s so few. If the US had not come up with this special group of people, our nation would be at great risk. In the news today, you don?t really see that much of the Navy SEALs at work, but quietly they are saving thousands of lives. You might ask: Why are these men saving so many lives. You have an area that contains weapons of mass destruction. And if you don?t destroy it, Seattle?s going to vanish; you do the math. Obviously, that has no truth of happening, but that?s just an example. These quiet professionals do their job, and they do it well. A SEAL is no ordinary troop. He?s a highly trained soldier who knows how to get in, leave no trace, and get out.
  7. Sure Mizako, but what about displaying information about how to connect to a database on the client side? You want to separate the processing logic (connecting to a database, etc.) from the presentation (waht the user sees). You wouldn't want a user to see how he/she can connect to your database do you? There are times when it would be better to put some of the scripting on the client side, for something such as a editor, but you would never want confidential information to be exposed.
  8. Linking a URL to a Button in Flash This seems to be a problem for beginners to Flash, and I thought I'd address it. When building a Flash-navigated site, you need to link one page to another through the flash interface, just like you would a <a href="otherpage.html">my link</a> in HTML/XHTML. Once you've created your button on the page, you can link the button very simply. Right-click it, and select "Actions" from the menu. This will open the ActionScript editor, in which you can right ActionScript code. Don't worry. It's not detailed to put this link in. Make sure you are in Expert Mode, by clicking the arrow in the upper-right hand corner and selecting "Expert Mode". Now type the following code into the editor. on (release) { getURL("the_linked_page.htm","_self","GET");}The button you created will now go to that link when the mouse clicks it. The getURL function has a prototype that is like this: getURL(url [,window [, method]]) The window and the method are optional parameters. The url define the resource you want to access. This could be an absolute address, such as "http://www.somesite.com/; or relative to the page that contains the flash movie such as "myotherpage.htm". The window parameter defines the window that you want the url to load in. This could be one of the following: "_self" - Targets the window that the movie is in. "_new" - Opens url in a new window "_top" - Only useful in a framset, targets the top frameset "_parent" - Targets parent window in a framset "myWindowName" - where "MyWindowName" refers to the name of a frame in a frameset The last parameter is one in which the method in which the url is requested, and is either "GET" or "POST". For most of your projects, you will normally use "GET". "POST" is for posting form data, but you usually use the loadVariables function to to this. That wraps up the tutorial on adding a link to a button in a Flash Movie. I hope this helps everyone. If you have any questions or comments, please reply to this post.
  9. Slow Motion Movies in Flash 5+ Hey, I just figured out how to create slow motion in ActionScript. Here's the scenario. You have a animation (frame by frame or tweened) that you want to let users be able to view in slow motion. The simplest way to do this would be to add some ActionScript. First, open your Flash movie that you want to create in slow-motion. Then select to Insert > New Symbol.... For the name type something like "slowMotion" (this doesn't really matter much), select the behavior "Movie Clip", and click "OK". Return to the scene without editing the Movie Clip. Now, drag an instance of the Movie Clip onto the stage, off to the side. Right-click on it, and select "Actions". This will bring up the ActionScript editor, in which you can edit your script. Make sure that you are in "Expert Mode". To set this, click the arrow in the upper-right corner of the Actionscript editing window and select "Expert Mode". This allows you to edit freely in the window. Copy this script and place it in the editor. onClipEvent (load) { isTrue = false; speed = 7; i = 1;} onClipEvent (enterFrame) { if (isTrue == true) { if (i == speed) { _root.play(); i=1; } else { _root.stop(); i++; } } else { _root.play(); }} Now that you have copied this script out, I want to explain a few parts of this. In the onClipEvent (load) we are defining some variables that we will use later. The onClipEvent (enterFrame) is a little bit more tricky. If the isTrue is set to true then the slow-motion "module" is activated, otherwise, the movie plays normally. The speed controls the delay of the playback in frames. If, for example, speed is set to "8", the slow-motion module will wait until eight frames' time has passed before it plays the movie for one frame. This creates the slow motion. We're not done yet. To link this to the page, you will have to do two things. First, you will have to select the slow-motion Movie Clip, go to the instance tab. (If you don't see it, check your panel layout.) Then, in the "Name" textbox, type an identifier like "slowMotionModule". That names the instance of the Movie Clip, and we can now reference it. Secondly, create button, and drag it onto the stage. Right-click on it and select "Actions". In the ActionScript editor enter this: on (release) { if (_root.slowMotionModule.isTrue == true) { _root.slowMotionModule.isTrue = false; } else { _root.slowMotionModule.isTrue = true; }} Where "slowMotionModule" is the name of the identifier you choose for the movie clip earlier. This script simply sets the isTrue variable for the Movie Clip instance. That wraps up the slow-motion. Test your movie, and you should see that when you click the slow motion button that your movie "slows down". One note that you should be aware of, is that this does not slow-down other movie clips on the stage. To slow them down, you would have to put the "slow-motion" movie clip in the other movie clip that you want to slow-down, and modify the button to point to the Movie Clip instead of _root, like this movie_clip_to_be_slowed_down.slowMotionModule.isTrue = true. I'm confident that you will be able to figure this one out. If you have any questions or comments, please reply to this message. If you are helped by this article, please rate me.
  10. I was wondering if someone could explain to me the differences / upgrades that are in JSP 2.0 over JSP 1.2. If someone could tell me what's new, or some websites to go to, it would be much appreciated. Thank you for your help.
  11. Here's where you get to say what server side programming language you prefer / like to use best!
  12. JavaScript Slideshow Tutorial I'm going to show you how to make a impressive JavaScript slideshow. First, you're probably asking: why would I want to make a slideshow in JavaScript? There are a number of reasons. First, you don't have to build a new HTML page for each picture. Secondly, the page will load much faster because the of the compactness of the page. Ok let's get started with this example. First we'll add a <script> tag in the <head> of our HTML document. In that script tag we will build the following: first = 1; last = 4; current = 1; function nextPicture() { // Hide current picture object = document.getElementById('slide' + current); object.style.display = 'none'; // Show next picture, if last, loop back to front if (current == last) { current = 1; } else { current++ } object = document.getElementById('slide' + current); object.style.display = 'block'; } function previousPicture() { // Hide current picture object = document.getElementById('slide' + current); object.style.display = 'none'; if (current == first) { current = last; } else { current--; } object = document.getElementById('slide' + current); object.style.display = 'block'; } First, I want you to look at the variables. first describes the first picture id, which is 1; last defines the last picture, and current holds the index of the current picture. The function nextPicture() hides the currently displayed picture, and displays the next picture using CSS controls. The function previousPicture() is almost exactly the same as nextPicture() except that it travels back one picture. Notice that current variable holds the current picture index. We are going to make this page styled through CSS. Here is my CSS code. you can change this to whatever you want. Put this in the <style> tag of your <head> tag. .slideShow { background-color: #ebebeb; text-align: center; margin-bottom: 10px; padding: 5px; } .slides { position: relative; z-index: 1; display: none; } .setTitle, .slideTitle { font-family: "Franklin Gothic Book", Arial, Helvitica, sans-serif; } .setTitle { color: #995a01; font-size: 14px; font-weight: bold; } .slideTitle { color: #666666; font-size: 12px; } .controls { position: relative; z-index: 10; } #slide1 { display: block; } img { border: outset 1px #999999; } Ok, now we are going to put our pictures in our page. We do this through standard HTML. I'll explain this part after we go over the code. <div class="slideShow"> <div class="setTitle">Jaguars Track and Field Photos</div> <div id="slide1" class="slides"> <div class="slideTitle">Picture 01</div> <img src="pic01.jpg" height="300" width="400" border="0" /> </div> <div id="slide2" class="slides"> <div class="slideTitle">Picture 02</div> <img src="pic02.jpg" height="300" width="400" border="0" /> </div> <div class="controls"> <a href="javascript:previousPicture()" style="margin: 10px;">Ť Previous</a> <a href="javascript:nextPicture()" style="margin: 10px;">Next ť</a> </div> </div> This code goes in the <body> tag. I just put two slides on here, but you can easily add more. Here is the format for adding more slides. You place another <div> inside of the <div class="slideShow"> like this: <div id="slideShow">...<div id="slide10"> <div class="slideTitle">Your Slide Title</div> <img src="pic10.jpg" height="600" width="430" border="0" /></div>....</div> Ok, when all of this is put together, you have a quite nice Javascript-enhanced slideshow! Here is the code for the whole page. Remember to edit the variable last to be the same as your last slide number. <!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&%2334; xml:lang="en" lang="en"> <head> <title>Slideshow</title> <script language="JavaScript" type="text/javascript"> //<!-- //<![CDATA[ first = 1; last = 4; current = 1; function nextPicture() { // Hide current picture object = document.getElementById('slide' + current); object.style.display = 'none'; // Show next picture, if last, loop back to front if (current == last) { current = 1; } else { current++ } object = document.getElementById('slide' + current); object.style.display = 'block'; } function previousPicture() { // Hide current picture object = document.getElementById('slide' + current); object.style.display = 'none'; if (current == first) { current = last; } else { current--; } object = document.getElementById('slide' + current); object.style.display = 'block'; } //]]> // --> </script> <style type="text/css"> <!-- .slideShow { background-color: #ebebeb; text-align: center; margin-bottom: 10px; padding: 5px; } .slides { position: relative; z-index: 1; display: none; } .setTitle, .slideTitle { font-family: "Franklin Gothic Book", Arial, Helvitica, sans-serif; } .setTitle { color: #995a01; font-size: 14px; font-weight: bold; } .slideTitle { color: #666666; font-size: 12px; } .controls { position: relative; z-index: 10; } #slide1 { display: block; } img { border: outset 1px #999999; } --> </style> </head> <body> <div class="slideShow"> <div class="setTitle">Your Title</div> <div id="slide1" class="slides"> <div class="slideTitle">Picture 01</div> <img src="pic01.jpg" height="300" width="400" border="0" /> </div> <div id="slide2" class="slides"> <div class="slideTitle">Picture 02</div> <img src="pic02.jpg" height="300" width="400" border="0" /> </div> <div id="slide3" class="slides"> <div class="slideTitle">Picture 03</div> <img src="pic03.jpg" height="300" width="400" border="0" /> </div> <div id="slide4" class="slides"> <div class="slideTitle">Picture 04</div> <img src="pic04.jpg" height="300" width="400" border="0" /> </div> <div class="controls"> <a href="javascript:previousPicture()" style="margin: 10px;">Ť Previous</a> <a href="javascript:nextPicture()" style="margin: 10px;">Next ť</a> </div> </div> </body></html> There you go! If you have any problems, suggestions, or questions please reply to this post. If you like this code, please rate me! Thanks
  13. It's not really that hard to learn JavaScript. Please check out my new tutorial on how to learn JavaScript. Beginning Javascript Tutorial It is a basic beginning to JavaScript, and it has several links to other websites that have good JavaScript code. Hope this helps!
  14. Introduction to Javascript Welcome to JavaScript. If you've never programmed in any computer language before and you want to learn JavaScript this is the tutorial you want to start with. I'm going to walk you through the basics of JavaScript with examples and then explain them. Ok, let's get started. Prerequisites This tutorial assumes that you know very little, or nothing about JavaScript. However I am going to assume that you know HTML, as these two work together. To code JavaScript you will need: * A Web Browser (such as Internet Explorer, Safari, Mozilla Firefox, Netscape 6.0+, Opera, etc.) Almost any browser will support JavaScript. * A Plain Text Editor. Almost anything will work for this. On Windows you can use Notepad or Wordpad. That's all that's required for learning JavaScript. Now let's get started. Javascript Syntax JavaScript has a syntax that is a lot like Java (although Java is not related to JavaScript) or C++. Here are a couple of things to remember. Javascript code is placed in an HTML file or a separate file (We'll get to that later). Code can be placed in the <head> or <body> tag of the HTML page. It is placed in a <script> tag. for JavaScript our script tag is going to look like this: <script language="JavaScript" type="text/javascript"></script> The language attribute tells the browser that the code inside will be JavaScript. The language attribute is going to be depreciated by the W3C, so we include the type tag so that we will be compliant with the standards. The type attribute is a MIME type. Comments are placed in the JavaScript code in two forms: /* This comment can span several lines because it is a multi-line comment. The comment may be in-between the the forward slashes and the astrieks. */ // This is a single-line comment Variables in JavaScript are easy to define. JavaScript is a weakly typed scripting language, which variables do not have to be declared as a certain type, such as as string, integer, or resource, etc. Here I have defined a few variables. variable1 = 100; myString = "Hello World"; Note that variables cannot start with numbers, but numbers can come later in the variable name. You should only use letters, numbers, and the underscore "_". Math functions are pretty much the same as they are in conventional mathematics. You can use +,-,/ (divide), * (multiply). We'll get into this later. Branching Statements I'll switch to an example now. In this section, I'll show how an if statement works. <html><head> <title>A Simple if Statment Example</title> <script language="JavaScript" type="text/javascript"> <!-- // The HTML comment above is for browsers that // cannot execute JavaScript. var1 = 12; if (var1 <= 8) { // If var1 is under or equal to 8 alert ("Var1 is under or equal to 8."); } else { alert ("Var1 is greater than 8."); } // Ending HTML comment // --> </script></head><body> <h1>A Simple if Statement Example</h1></body></html>Save this file as ifexample.html and check it out in your browser. The code should run, if you have JavaScript enabled, and you should see an alert that says "Var1 is greater than 8." This code above decides whether var1 is under or equal to 8 and if not goes on to the else statement. This script doesn't do much, but it is your first introduction to JavaScript. Here is another JavaScript example that runs a loop that prints out the value of x until x is greater than or equals 100. <html><head> <title>A while () Statement Example</title> <script language="JavaScript" type="text/javascript"> <!-- // The HTML comment above is for browsers that // cannot execute JavaScript. x = 1; while (x <= 100) { document.writeln(x + ", "); } // Ending HTML comment // --> </script></head><body></body></html>This code runs the while statement until x equals 100. Well that's it for the basic JavaScript tutorial. If your interested to learn more go to these sites. Some of them are pure JavaScript, and others contain DHTML (Dynamic HTML) which is a combination of JavaScript, HTML, and CSS (Cascading Style Sheets). https://www.codeschool.com/ http://www.javascriptkit.com/ http://www.ruleweb.com/ http://www.dynamicdrive.com/http://www.dynamicdrive.com/ Please reply if you have any basic questions on JavaScript. I will try to help you as best as I can with your problems/questions/suggestions. If you like this article, please be sure and rate me.
  15. True, but if you want to put some form of javascript or cgi, php, jsp error checking mechanism it works just as good.
  16. Netscape Browser Resize Fix Sorry, but I couldn't find the edit button, so I had to double post. Briefly, I'll explain the Netscape browser resize bug. First, the problem is that when you resize Netscape 4.x all the CSS styling disappears, and the html formatting takes over. To fix this you must use some JavaScript. First, you need to place this code in the <head> tag of your page. <script language="javascript" type="text/javascript"> //<!-- //<![CDATA[ function refreshPage () { location.href = location.href; } if (navigator.appName.indexOf("Netscape") != -1 && parseInt(navigator.appVersion) == 4) { window.onresize = refreshPage(); } // ]]> // --></script> This will solve the resize bug. Reply if this helps you at all.
  17. I did a blendTrans effect on one of my projects, and here is the code. I had this in my script tag: // rollover functions if (document.images) { imagearray = new Array(); imagearray[0] = "images/nav1.gif"; imagearray[1] = "images/nav1on.gif"; inum = new Array(); for (i=0; i<imagearray.length; i++) { inum[i] = new Image(); inum[i].src = imagearray[i]; }}function imgchange (imgName, imagenum) { if (document.images) { if (navigator.appName.indexOf("Microsoft Internet Explorer") { // Internet Explorer document[imgName].filters(0).apply(); document[imgName].src = inum[imagenum].src; document[imgName].filters(0).play(); } else { // Other browsers that don't support it document[imgName].src = inum[imagenum].src; } }} Next, you need to put this in the <style> tag: img { filter: blendTrans(duration=1.0); } This contains the code that powers the rollover. Now to apply it: <a href="" onmouseover="imgchange('nav1',1)" onmouseout="imgchange('nav1',0)"><img name="nav1" src="images/nav1.gif" width="130" height="20" alt="" border="0" /></a> Let me briefly explain the imgchange function... function imgchange ( image_name, array_index); This is put in the onmouseover and onmouseout statements. The image_name refers the the <img name="value" /> reference, and the array_index refers the the image in the array index value. Example: changeimg('name',0) would refer to imagearray[0]. make sure that you have placed a name="value" in the image tag, and that the changeimg(name,5) in the onmouseover and onmouseout match this. To add more images... To add more images, you simply need to put another imagearray[next_number] = "images/nav3on.gif"; in the script tag, where next_number equals the next array number. Ok? Then add another <a href="#link" onmouseover="changeimg(...)" onmouseout="changeimg(...)"><img src="" name="next_img" /></a> in the body where you want it. Hope you all can figure this out. NOTE: The reason why we test and see if the browser is IE is because this only works in Internet Explorer. Other browsers will just see a standard rollover; If you want to change the duration of the effect, change the duration length (its in seconds.)
  18. Additional CSS Stuff Here are a couple more basic CSS tips that might be helpful: First, if you want to access a element further down within a structure, you can prefix the element you want to add the styles to with the element name. For example: <style type="text/css"><!-- /* Here we want to define a style for a <span> element inside of a <div> element */ div span { font-size: larger; }--></style>In the previous example, we've taken a <span> element and given it a style based on its parent tag being a <div> tag. This way you can create unique styles without having to give it a class or an id. Font Styling I'm going to show you some easy font controls in css. This is part of what makes css so much more powerful than plain HTML. You can precisely control the appearance of your page with css. I'll just list several css directives that you can use to format your text with: font-family: Name_of_font, Name_of_backup_font, etc; font-size: [x-small, small, medium, large, larger], [12 px, 15pt, 3ex (the height of the letter "x" in the font)]; // These are just several possibilities. Subsitute your own values in. font-weight: 100-800, [normal, bold, bolder]; //These control the font weight, or how bold it is color: [#00000, "Hexadecimal"],[rgb(255,255,255) "Red Green and Blue Values, respectively, with values from 1 to 255] or the sixteen pre-defined colors such as [red,green,blue,black,white,orange,magenta,silver,etc.]; Other Directives that may be useful would be: line-height:px, pc (picas), pt, in, mm, cm, em (height of the letter "m" in the font) letter-spacing: Same as above Browser Bugs Don't freak out if your css is not working the way you want it to. Sometimes certain browsers don't support css the way the W3C (World Wide Web Consortium) wants it to be. You can't always fix that. Netscape 4.x has a bug where if you resize the page, the page loses its styling. I'll write a quick article on how to fix that too. Just remember, its not all your fault. I guess that's all I have to say for now. I'll try to post more stuff for you that need to learn css. Hope that this helps.
  19. I would say to go to http://www.xml.com/. This site contains hundreds of pages on xml, xslt, rss feeds, and web services. Here is a page about xml that tells what xml is, how it is related to SGML (Stanardized General Markup Language), and HTML. http://www.xml.com/pub/a/98/10/guide0.html Hope that helps you some!
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.