SlideShare una empresa de Scribd logo
1 de 4
Descargar para leer sin conexión
範例:利用WebViewer與ActivityStarter連到外部網站 
需求: 
建立一個有一文字輸入欄位及兩個按鈕一為『open inside』,『open outside』的頁面。 
文字輸入欄位可以輸入url。如果沒有輸入在按下按鈕時就會跳到聯合報首頁。 
按下『open inside』會將網頁顯示在app裡面。按下『open outside』則會將網頁顯示在另外開 
啟的瀏覽器中。 
設計師元件佈置作業: 
1.在頁面放入 WEBViewer 、TextBox、兩個Button元件及ActivityStarter元件。另外說明部分是 
用Label元件做的 
元件名稱 Properties屬性設定 
WebViewer(WebViewer1) Width:fill parent 
TextBox(txt_url) Width:fill parent 
Button(btn_inside) 
Button(btn_outside) 
ActivityStarter1(ActivityStarter1) 一定要設 
Action:android.intent.action.VIEW 
示意圖如下:
Blocks拼塊編輯作業: 
1. 進入Blocks拼塊編輯作業裡點選左側Built in 裡Variables的設定一個全域變數(url)。設 
定其為空值。 
2. 設定按下『btn_inside』時的事件。 
a. 點選左側Screen1­> 
btnRed­> 
『When btn_inside.Click do』拖拉到Viewer中。 
b. 設定有沒有輸入網址。點選左側Built in­> 
Control­> 
『if then』將此拼塊拖拉到『 
When btn_inside.Click do』中。並將中間的『=』改成『≠』。 
c. if 的第一個缺口放入『txt.url.Text』(從txt_url物件中選擇的)。第二個缺口則是 
填入空字串(從Text選擇的)。 
d. then 旁的缺口則是要放入『set global url to 』(從Variables中選到的)。『set 
global url to 』旁的缺口放入『txt_url.Text』(從txt_url物件中選擇的)。 
e. 加入一個『else』條件。『else』旁的缺口則是要放入『set global url to 』。『 
set global url to 』旁的缺口放入”http://udn.com”字串(從Text選擇後填寫)。 
f. 點選左側WebViewer1物件選擇『call WebViewer1.GoToUrl』放到剛剛設定的『 
if then else』下方。 
g. WebViewer1物件 url旁的缺口放入『get global url』(從Variables中選到的)。 
這樣就完成按下『btn_inside』時的事件。 
3. 設定按下『btn_outside』時的事件。 
a. 點選左側Screen1­> 
btnRed­> 
『When btn_outside.Click do』拖拉到Viewer中。 
b. 設定有沒有輸入網址。點選左側Built in­> 
Control­> 
『if then』將此拼塊拖拉到『 
When btn_inside.Click do』中。並將中間的『=』改成『≠』。 
c. if 的第一個缺口放入『txt.url.Text』(從txt_url物件中選擇的)。第二個缺口則是 
填入空字串(從Text選擇的)。 
d. then 旁的缺口則是要放入『set global url to 』(從Variables中選到的)。『set 
global url to 』旁的缺口放入『txt_url.Text』(從txt_url物件中選擇的)。 
e. 加入一個『else』條件。『else』旁的缺口則是要放入『set global url to 』。『 
set global url to 』旁的缺口放入”http://udn.com”字串(從Text選擇後填寫)。 
f. 點選左側ActivityStarter1物件選擇『set ActivityStarter1.DataUrl to』, 放到剛剛 
設定的『if then else』下方。 
g. 『set ActivityStarter1.DataUrl to』旁的缺口請放入『get global url』(從 
Variables中選到的)。 
h. 再點選左側ActivityStarter1物件選擇『call ActivityStarter1.StartActivity』,放到 
『set ActivityStarter1.DataUrl to』下方。這樣就完成了設定按下『btn_outside 
』時的事件。
示意圖如下 
完成了,來看看其中按下『open inside』的畫面吧。畫面如下:
Sample aia 檔案下載網址:http://goo.gl/R45FUS 
apk 下載網址:http://goo.gl/EwtPv1

Más contenido relacionado

La actualidad más candente

Learning OpenFlow with OVS on BPI R1 and Zodiac FX
Learning OpenFlow with OVS on BPI R1 and Zodiac FXLearning OpenFlow with OVS on BPI R1 and Zodiac FX
Learning OpenFlow with OVS on BPI R1 and Zodiac FXTelematika Open Session
 
#261 人因工程圖例 Human factor engineering
#261 人因工程圖例 Human factor engineering#261 人因工程圖例 Human factor engineering
#261 人因工程圖例 Human factor engineeringFast SiC Semiconductor Inc.
 
pixivのインフラを支える技術
pixivのインフラを支える技術pixivのインフラを支える技術
pixivのインフラを支える技術Ryuta Kamizono
 
休Ch02 休閒事業的策略管理(一) 基本策略的擬訂
休Ch02 休閒事業的策略管理(一) 基本策略的擬訂休Ch02 休閒事業的策略管理(一) 基本策略的擬訂
休Ch02 休閒事業的策略管理(一) 基本策略的擬訂蜨穆 諾淦
 
資訊安全入門
資訊安全入門資訊安全入門
資訊安全入門Tyler Chen
 
[系列活動] 手把手打開Python資料分析大門
[系列活動] 手把手打開Python資料分析大門[系列活動] 手把手打開Python資料分析大門
[系列活動] 手把手打開Python資料分析大門台灣資料科學年會
 
vSRX on Your Laptop : PCで始めるvSRX ~JUNOSをさわってみよう!~
vSRX on Your Laptop : PCで始めるvSRX ~JUNOSをさわってみよう!~vSRX on Your Laptop : PCで始めるvSRX ~JUNOSをさわってみよう!~
vSRX on Your Laptop : PCで始めるvSRX ~JUNOSをさわってみよう!~Juniper Networks (日本)
 
作業現場稽核重點 Tip 8 for On-Site Audit
作業現場稽核重點 Tip 8 for On-Site Audit作業現場稽核重點 Tip 8 for On-Site Audit
作業現場稽核重點 Tip 8 for On-Site AuditFast SiC Semiconductor Inc.
 
mbot2.0教學-四路顏色感測器應用.pdf
mbot2.0教學-四路顏色感測器應用.pdfmbot2.0教學-四路顏色感測器應用.pdf
mbot2.0教學-四路顏色感測器應用.pdf吳錫修 (ShyiShiou Wu)
 
CW4Sの手引き - Juniper SRX GUI設定支援ツール
CW4Sの手引き - Juniper SRX GUI設定支援ツールCW4Sの手引き - Juniper SRX GUI設定支援ツール
CW4Sの手引き - Juniper SRX GUI設定支援ツールJuniper Networks (日本)
 

La actualidad más candente (20)

Learning OpenFlow with OVS on BPI R1 and Zodiac FX
Learning OpenFlow with OVS on BPI R1 and Zodiac FXLearning OpenFlow with OVS on BPI R1 and Zodiac FX
Learning OpenFlow with OVS on BPI R1 and Zodiac FX
 
#261 人因工程圖例 Human factor engineering
#261 人因工程圖例 Human factor engineering#261 人因工程圖例 Human factor engineering
#261 人因工程圖例 Human factor engineering
 
pixivのインフラを支える技術
pixivのインフラを支える技術pixivのインフラを支える技術
pixivのインフラを支える技術
 
休Ch02 休閒事業的策略管理(一) 基本策略的擬訂
休Ch02 休閒事業的策略管理(一) 基本策略的擬訂休Ch02 休閒事業的策略管理(一) 基本策略的擬訂
休Ch02 休閒事業的策略管理(一) 基本策略的擬訂
 
Visual basic
Visual basicVisual basic
Visual basic
 
精實6S Lean 6S
精實6S Lean 6S精實6S Lean 6S
精實6S Lean 6S
 
品牌經營與產品開發
品牌經營與產品開發品牌經營與產品開發
品牌經營與產品開發
 
mBot 教學6 光感測器與LED應用
mBot 教學6 光感測器與LED應用mBot 教學6 光感測器與LED應用
mBot 教學6 光感測器與LED應用
 
mBot 教學5 超音波感測應用
mBot 教學5 超音波感測應用mBot 教學5 超音波感測應用
mBot 教學5 超音波感測應用
 
工作改善
工作改善工作改善
工作改善
 
現場生產力管理 productivity management
現場生產力管理 productivity management現場生產力管理 productivity management
現場生產力管理 productivity management
 
品管圈輔導實務 coaching skill
品管圈輔導實務 coaching skill品管圈輔導實務 coaching skill
品管圈輔導實務 coaching skill
 
資訊安全入門
資訊安全入門資訊安全入門
資訊安全入門
 
[系列活動] 手把手打開Python資料分析大門
[系列活動] 手把手打開Python資料分析大門[系列活動] 手把手打開Python資料分析大門
[系列活動] 手把手打開Python資料分析大門
 
vSRX on Your Laptop : PCで始めるvSRX ~JUNOSをさわってみよう!~
vSRX on Your Laptop : PCで始めるvSRX ~JUNOSをさわってみよう!~vSRX on Your Laptop : PCで始めるvSRX ~JUNOSをさわってみよう!~
vSRX on Your Laptop : PCで始めるvSRX ~JUNOSをさわってみよう!~
 
作業現場稽核重點 Tip 8 for On-Site Audit
作業現場稽核重點 Tip 8 for On-Site Audit作業現場稽核重點 Tip 8 for On-Site Audit
作業現場稽核重點 Tip 8 for On-Site Audit
 
mbot2.0教學-四路顏色感測器應用.pdf
mbot2.0教學-四路顏色感測器應用.pdfmbot2.0教學-四路顏色感測器應用.pdf
mbot2.0教學-四路顏色感測器應用.pdf
 
mBot 教學8 巡跡控制應用
mBot 教學8 巡跡控制應用mBot 教學8 巡跡控制應用
mBot 教學8 巡跡控制應用
 
CW4Sの手引き - Juniper SRX GUI設定支援ツール
CW4Sの手引き - Juniper SRX GUI設定支援ツールCW4Sの手引き - Juniper SRX GUI設定支援ツール
CW4Sの手引き - Juniper SRX GUI設定支援ツール
 
8 клас урок 51
8 клас урок 518 клас урок 51
8 клас урок 51
 

Destacado

App inventor 教學講義 chapter1
App inventor 教學講義 chapter1App inventor 教學講義 chapter1
App inventor 教學講義 chapter1Jerry Wu
 
App inventor 教學講義 chapter2
App inventor 教學講義 chapter2App inventor 教學講義 chapter2
App inventor 教學講義 chapter2Jerry Wu
 
App inventor 教學講義 chapter4
App inventor 教學講義 chapter4App inventor 教學講義 chapter4
App inventor 教學講義 chapter4Jerry Wu
 
App inventor 教學講義 chapter3
App inventor 教學講義 chapter3App inventor 教學講義 chapter3
App inventor 教學講義 chapter3Jerry Wu
 
App inventor 教學講義 chapter6
App inventor 教學講義 chapter6App inventor 教學講義 chapter6
App inventor 教學講義 chapter6Jerry Wu
 
App inventor 演講簡報
App inventor 演講簡報App inventor 演講簡報
App inventor 演講簡報David Huang
 
App inventor 4
App inventor 4App inventor 4
App inventor 4Roy Wang
 
Arduino Yun 物聯網 Lesson 2
Arduino Yun 物聯網 Lesson 2Arduino Yun 物聯網 Lesson 2
Arduino Yun 物聯網 Lesson 2CAVEDU Education
 
App inventor 1
App inventor 1App inventor 1
App inventor 1Roy Wang
 
飲水松-開放街圖簡介 drinking water map and openstreetmap
飲水松-開放街圖簡介 drinking water map and openstreetmap飲水松-開放街圖簡介 drinking water map and openstreetmap
飲水松-開放街圖簡介 drinking water map and openstreetmapDennis Raylin Chen
 
Arduino 習作工坊 - Lesson 4 通訊之夜
Arduino 習作工坊 -  Lesson 4 通訊之夜Arduino 習作工坊 -  Lesson 4 通訊之夜
Arduino 習作工坊 - Lesson 4 通訊之夜CAVEDU Education
 
iOS On Boarding Training
iOS On Boarding TrainingiOS On Boarding Training
iOS On Boarding TrainingRyan Chung
 
PHP也有day #27 - From apprentice to artisan 解耦合處理程序及單元測試
PHP也有day #27 - From apprentice to artisan 解耦合處理程序及單元測試PHP也有day #27 - From apprentice to artisan 解耦合處理程序及單元測試
PHP也有day #27 - From apprentice to artisan 解耦合處理程序及單元測試亮亮 閃
 
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練3
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練32016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練3
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練3Duran Hsieh
 
160901 翻轉開發,活用雲端創新技術@IBM Cloud Innovation Day
160901  翻轉開發,活用雲端創新技術@IBM Cloud Innovation Day160901  翻轉開發,活用雲端創新技術@IBM Cloud Innovation Day
160901 翻轉開發,活用雲端創新技術@IBM Cloud Innovation DayCAVEDU Education
 
如何選擇合適的網站製作平台
如何選擇合適的網站製作平台如何選擇合適的網站製作平台
如何選擇合適的網站製作平台Hui Chieh Chiu
 
凌波微步:wagon + VS Code 的輕功哲學
凌波微步:wagon + VS Code 的輕功哲學凌波微步:wagon + VS Code 的輕功哲學
凌波微步:wagon + VS Code 的輕功哲學Shengyou Fan
 

Destacado (20)

App inventor 教學講義 chapter1
App inventor 教學講義 chapter1App inventor 教學講義 chapter1
App inventor 教學講義 chapter1
 
App inventor 教學講義 chapter2
App inventor 教學講義 chapter2App inventor 教學講義 chapter2
App inventor 教學講義 chapter2
 
App inventor 教學講義 chapter4
App inventor 教學講義 chapter4App inventor 教學講義 chapter4
App inventor 教學講義 chapter4
 
App inventor 教學講義 chapter3
App inventor 教學講義 chapter3App inventor 教學講義 chapter3
App inventor 教學講義 chapter3
 
App inventor 教學講義 chapter6
App inventor 教學講義 chapter6App inventor 教學講義 chapter6
App inventor 教學講義 chapter6
 
App inventor 演講簡報
App inventor 演講簡報App inventor 演講簡報
App inventor 演講簡報
 
App inventor 4
App inventor 4App inventor 4
App inventor 4
 
Arduino Yun 物聯網 Lesson 2
Arduino Yun 物聯網 Lesson 2Arduino Yun 物聯網 Lesson 2
Arduino Yun 物聯網 Lesson 2
 
App inventor 1
App inventor 1App inventor 1
App inventor 1
 
飲水松-開放街圖簡介 drinking water map and openstreetmap
飲水松-開放街圖簡介 drinking water map and openstreetmap飲水松-開放街圖簡介 drinking water map and openstreetmap
飲水松-開放街圖簡介 drinking water map and openstreetmap
 
Arduino 習作工坊 - Lesson 4 通訊之夜
Arduino 習作工坊 -  Lesson 4 通訊之夜Arduino 習作工坊 -  Lesson 4 通訊之夜
Arduino 習作工坊 - Lesson 4 通訊之夜
 
iOS On Boarding Training
iOS On Boarding TrainingiOS On Boarding Training
iOS On Boarding Training
 
APP Inventor as a Tool to Reach Students
APP Inventor as a Tool to Reach StudentsAPP Inventor as a Tool to Reach Students
APP Inventor as a Tool to Reach Students
 
PHP也有day #27 - From apprentice to artisan 解耦合處理程序及單元測試
PHP也有day #27 - From apprentice to artisan 解耦合處理程序及單元測試PHP也有day #27 - From apprentice to artisan 解耦合處理程序及單元測試
PHP也有day #27 - From apprentice to artisan 解耦合處理程序及單元測試
 
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練3
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練32016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練3
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練3
 
App Inventor tutorial
App Inventor tutorialApp Inventor tutorial
App Inventor tutorial
 
160901 翻轉開發,活用雲端創新技術@IBM Cloud Innovation Day
160901  翻轉開發,活用雲端創新技術@IBM Cloud Innovation Day160901  翻轉開發,活用雲端創新技術@IBM Cloud Innovation Day
160901 翻轉開發,活用雲端創新技術@IBM Cloud Innovation Day
 
mbot初體驗
mbot初體驗mbot初體驗
mbot初體驗
 
如何選擇合適的網站製作平台
如何選擇合適的網站製作平台如何選擇合適的網站製作平台
如何選擇合適的網站製作平台
 
凌波微步:wagon + VS Code 的輕功哲學
凌波微步:wagon + VS Code 的輕功哲學凌波微步:wagon + VS Code 的輕功哲學
凌波微步:wagon + VS Code 的輕功哲學
 

Similar a App inventor2利用WebViewer與ActivityStarter連到外部網站

Flex20100906
Flex20100906Flex20100906
Flex20100906reasonpun
 
只需要懂Jquery也能學react js
只需要懂Jquery也能學react js只需要懂Jquery也能學react js
只需要懂Jquery也能學react jsJustin Wu
 
如何添加图片新闻帮助手册
如何添加图片新闻帮助手册如何添加图片新闻帮助手册
如何添加图片新闻帮助手册havenchen
 
第1讲 开始编写程序
第1讲 开始编写程序第1讲 开始编写程序
第1讲 开始编写程序ruandao
 
第12章
第12章第12章
第12章paoapao
 
沈阳师范大学课程实践 Android开发应用
沈阳师范大学课程实践 Android开发应用沈阳师范大学课程实践 Android开发应用
沈阳师范大学课程实践 Android开发应用ArBing Xie
 
沈阳师范大学课程实践 Android开发应用
沈阳师范大学课程实践 Android开发应用沈阳师范大学课程实践 Android开发应用
沈阳师范大学课程实践 Android开发应用ArBing Xie
 
沈阳师范大学课程实践 Android开发应用
沈阳师范大学课程实践 Android开发应用沈阳师范大学课程实践 Android开发应用
沈阳师范大学课程实践 Android开发应用ArBing Xie
 
《网页设计与制作》第三章:插入网页基本元素
《网页设计与制作》第三章:插入网页基本元素《网页设计与制作》第三章:插入网页基本元素
《网页设计与制作》第三章:插入网页基本元素greentask
 
Mobile App 高保真原型设计
Mobile App 高保真原型设计 Mobile App 高保真原型设计
Mobile App 高保真原型设计 hehewish
 
Biee管理员手册1.0
Biee管理员手册1.0Biee管理员手册1.0
Biee管理员手册1.0syong09
 
twMVC#23 | 快速上手 Azure Functions
twMVC#23 | 快速上手 Azure FunctionstwMVC#23 | 快速上手 Azure Functions
twMVC#23 | 快速上手 Azure FunctionstwMVC
 
Android Wear SDK: Level 101
Android Wear SDK: Level 101Android Wear SDK: Level 101
Android Wear SDK: Level 101Jollen Chen
 
Bmi 計算--APP inventor
Bmi 計算--APP inventorBmi 計算--APP inventor
Bmi 計算--APP inventorcfchen
 
3-5如何將數位之牆的[部落輪播]功能放入Google的部落格(HTML/JavaScript網頁元素)
3-5如何將數位之牆的[部落輪播]功能放入Google的部落格(HTML/JavaScript網頁元素)3-5如何將數位之牆的[部落輪播]功能放入Google的部落格(HTML/JavaScript網頁元素)
3-5如何將數位之牆的[部落輪播]功能放入Google的部落格(HTML/JavaScript網頁元素)p_yang
 
Anroid development part.1
Anroid development part.1Anroid development part.1
Anroid development part.1RANK LIU
 

Similar a App inventor2利用WebViewer與ActivityStarter連到外部網站 (20)

Flex20100906
Flex20100906Flex20100906
Flex20100906
 
只需要懂Jquery也能學react js
只需要懂Jquery也能學react js只需要懂Jquery也能學react js
只需要懂Jquery也能學react js
 
如何添加图片新闻帮助手册
如何添加图片新闻帮助手册如何添加图片新闻帮助手册
如何添加图片新闻帮助手册
 
第1讲 开始编写程序
第1讲 开始编写程序第1讲 开始编写程序
第1讲 开始编写程序
 
翔宇使用
翔宇使用翔宇使用
翔宇使用
 
I os 01
I os 01I os 01
I os 01
 
第12章
第12章第12章
第12章
 
沈阳师范大学课程实践 Android开发应用
沈阳师范大学课程实践 Android开发应用沈阳师范大学课程实践 Android开发应用
沈阳师范大学课程实践 Android开发应用
 
沈阳师范大学课程实践 Android开发应用
沈阳师范大学课程实践 Android开发应用沈阳师范大学课程实践 Android开发应用
沈阳师范大学课程实践 Android开发应用
 
沈阳师范大学课程实践 Android开发应用
沈阳师范大学课程实践 Android开发应用沈阳师范大学课程实践 Android开发应用
沈阳师范大学课程实践 Android开发应用
 
Coimotion api
Coimotion apiCoimotion api
Coimotion api
 
《网页设计与制作》第三章:插入网页基本元素
《网页设计与制作》第三章:插入网页基本元素《网页设计与制作》第三章:插入网页基本元素
《网页设计与制作》第三章:插入网页基本元素
 
Mobile App 高保真原型设计
Mobile App 高保真原型设计 Mobile App 高保真原型设计
Mobile App 高保真原型设计
 
Biee管理员手册1.0
Biee管理员手册1.0Biee管理员手册1.0
Biee管理员手册1.0
 
twMVC#23 | 快速上手 Azure Functions
twMVC#23 | 快速上手 Azure FunctionstwMVC#23 | 快速上手 Azure Functions
twMVC#23 | 快速上手 Azure Functions
 
Android design4.0
Android design4.0Android design4.0
Android design4.0
 
Android Wear SDK: Level 101
Android Wear SDK: Level 101Android Wear SDK: Level 101
Android Wear SDK: Level 101
 
Bmi 計算--APP inventor
Bmi 計算--APP inventorBmi 計算--APP inventor
Bmi 計算--APP inventor
 
3-5如何將數位之牆的[部落輪播]功能放入Google的部落格(HTML/JavaScript網頁元素)
3-5如何將數位之牆的[部落輪播]功能放入Google的部落格(HTML/JavaScript網頁元素)3-5如何將數位之牆的[部落輪播]功能放入Google的部落格(HTML/JavaScript網頁元素)
3-5如何將數位之牆的[部落輪播]功能放入Google的部落格(HTML/JavaScript網頁元素)
 
Anroid development part.1
Anroid development part.1Anroid development part.1
Anroid development part.1
 

App inventor2利用WebViewer與ActivityStarter連到外部網站

  • 1. 範例:利用WebViewer與ActivityStarter連到外部網站 需求: 建立一個有一文字輸入欄位及兩個按鈕一為『open inside』,『open outside』的頁面。 文字輸入欄位可以輸入url。如果沒有輸入在按下按鈕時就會跳到聯合報首頁。 按下『open inside』會將網頁顯示在app裡面。按下『open outside』則會將網頁顯示在另外開 啟的瀏覽器中。 設計師元件佈置作業: 1.在頁面放入 WEBViewer 、TextBox、兩個Button元件及ActivityStarter元件。另外說明部分是 用Label元件做的 元件名稱 Properties屬性設定 WebViewer(WebViewer1) Width:fill parent TextBox(txt_url) Width:fill parent Button(btn_inside) Button(btn_outside) ActivityStarter1(ActivityStarter1) 一定要設 Action:android.intent.action.VIEW 示意圖如下:
  • 2. Blocks拼塊編輯作業: 1. 進入Blocks拼塊編輯作業裡點選左側Built in 裡Variables的設定一個全域變數(url)。設 定其為空值。 2. 設定按下『btn_inside』時的事件。 a. 點選左側Screen1­> btnRed­> 『When btn_inside.Click do』拖拉到Viewer中。 b. 設定有沒有輸入網址。點選左側Built in­> Control­> 『if then』將此拼塊拖拉到『 When btn_inside.Click do』中。並將中間的『=』改成『≠』。 c. if 的第一個缺口放入『txt.url.Text』(從txt_url物件中選擇的)。第二個缺口則是 填入空字串(從Text選擇的)。 d. then 旁的缺口則是要放入『set global url to 』(從Variables中選到的)。『set global url to 』旁的缺口放入『txt_url.Text』(從txt_url物件中選擇的)。 e. 加入一個『else』條件。『else』旁的缺口則是要放入『set global url to 』。『 set global url to 』旁的缺口放入”http://udn.com”字串(從Text選擇後填寫)。 f. 點選左側WebViewer1物件選擇『call WebViewer1.GoToUrl』放到剛剛設定的『 if then else』下方。 g. WebViewer1物件 url旁的缺口放入『get global url』(從Variables中選到的)。 這樣就完成按下『btn_inside』時的事件。 3. 設定按下『btn_outside』時的事件。 a. 點選左側Screen1­> btnRed­> 『When btn_outside.Click do』拖拉到Viewer中。 b. 設定有沒有輸入網址。點選左側Built in­> Control­> 『if then』將此拼塊拖拉到『 When btn_inside.Click do』中。並將中間的『=』改成『≠』。 c. if 的第一個缺口放入『txt.url.Text』(從txt_url物件中選擇的)。第二個缺口則是 填入空字串(從Text選擇的)。 d. then 旁的缺口則是要放入『set global url to 』(從Variables中選到的)。『set global url to 』旁的缺口放入『txt_url.Text』(從txt_url物件中選擇的)。 e. 加入一個『else』條件。『else』旁的缺口則是要放入『set global url to 』。『 set global url to 』旁的缺口放入”http://udn.com”字串(從Text選擇後填寫)。 f. 點選左側ActivityStarter1物件選擇『set ActivityStarter1.DataUrl to』, 放到剛剛 設定的『if then else』下方。 g. 『set ActivityStarter1.DataUrl to』旁的缺口請放入『get global url』(從 Variables中選到的)。 h. 再點選左側ActivityStarter1物件選擇『call ActivityStarter1.StartActivity』,放到 『set ActivityStarter1.DataUrl to』下方。這樣就完成了設定按下『btn_outside 』時的事件。
  • 4. Sample aia 檔案下載網址:http://goo.gl/R45FUS apk 下載網址:http://goo.gl/EwtPv1