Embed Flash Yahoo Weather in your page with Yahoo APIs
2009-10-20 00:00:00 来源:WEB开发网本文源代码下载地址: http://flashview.ddvip.com/2009_10/weather.zip
If you have a touristic website about a city or a travel agency, it may be useful displaying the weather somewhere in the page.
There are hundreds of free services solving the task, but none of them comes without watermark, is fully customizable and has a dedicated AS3 API like Yahoo’s one.
Let’s see how to embed it in a Flash movie.
Prepare your folder
Once you unzipped the file, copy the com directory inside the Source one in the main folder, the same you are using for your project, or create your project in the Source folder.
If you choose to copy the com directory, your folder will look like this:
The script
First, you need to retrieve your location code. Go to this page and search for the weather in your city. Then, look at the url of the page… in my case, looking for Venice, Italy, it’s this one:
http://weather.yahoo.com/forecast/ITXX0085.html
That means the city code for Venice is ITXX0085.
Now it’s time to look at the script:
- ››FLASH不等于运算符!=的使用实例
- ››FLASH不全等运算符!==
- ››FLASH字符串分隔符运算符
- ››FLASH% 模运算符
- ››Flash+、++、+= 加法运算符
- ››Flash, 逗号运算符
- ››flash中的-、--、-=减法运算符
- ››Flash的-Infinity 常数、.点运算符、/ 除法运算符...
- ››Flash两种注释方法/*..*/ 和// 注释行分隔符运算符...
- ››Flash的/=除法赋值运算符、=赋值运算符、== 等于运...
- ››Flash之?: 条件运算符、^ 按位 XOR 运算符、^= 按...
- ››Flash的_framesloaded代码示例
赞助商链接