Flex 모바일 앱에서 Google+와 Facebook을 포함한 5 가지 소셜 네트워크를 통해 OAuth 로그인을 처리하는 5 View입니다. View
의 상기 메뉴를 통해 선택되는 아래와 :Flex mxml 파일을 사용한 상속 - 스크린 샷 첨부
파일명
가 FB.mxml, GG.mxml, MR.mxml, OK.mxml, VK.mxml 그들의 소스 코드 을 보이는 매우있다 비슷한 :
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
viewActivate="loadInfo(event)"
viewDeactivate="closeSWV(event)"
title="Facebook.com">
....
private function closeSWV(event:Event=null):void {
_busy.visible = _busy.includeInLayout = false;
_reload.visible = _reload.includeInLayout = true;
stage.removeEventListener(Event.RESIZE, resizeSWV);
if (! _swv)
return;
_swv.removeEventListener(Event.COMPLETE, extractAccessToken);
_swv.removeEventListener(LocationChangeEvent.LOCATION_CHANGE, extractAccessToken);
_swv.removeEventListener(IOErrorEvent.IO_ERROR, closeSWV);
_swv.removeEventListener(ErrorEvent.ERROR, closeSWV);
_swv.dispose();
_swv = null;
}
private function resizeSWV(event:Event=null):void {
if (! _swv)
return;
// align to the right-bottom corner
_swv.viewPort = new Rectangle(stage.stageWidth - Preferans.SCALE * width,
stage.stageHeight - Preferans.SCALE * height,
Preferans.SCALE * width,
Preferans.SCALE * height);
}
....
<s:VGroup>
<s:Label id="_first" fontWeight="bold" text="Your name:" />
<s:Label id="_gender" fontWeight="bold" text="Gender:" />
<s:Label id="_city" fontWeight="bold" text="City:" />
</s:VGroup>
<s:Button id="_play"
label="Play"
click="startGame(event)"
includeInLayout="false"
visible="false" />
</s:View>
내 문제는 : 위에 나열된 5 개 MXML 파일은 많은 유사한 방법과 변수와 UI 요소와 단지 몇 가지 방법과 변수를 가지고있다.
mxml 파일 (순수 AS3 클래스와 비교하여)이 간단하지 않기 때문에 여러 번 "기본 클래스"를 여러 번 소개하려고 시도했지만 항상 포기했습니다.
누구나 아이디어를 얻으시겠습니까?이 문제를 어떻게 해결합니까?
고맙겠지 만 _name, _gender, _city와 같은 일반적인 UI 요소를 추가하는 위치 (파일에서) 내 질문에 나열된 레이블은 무엇입니까? –