From c65295770b1ee893efcd05062081e5f2ccbf26bc Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Mon, 19 Oct 2020 14:39:55 +0330 Subject: [PATCH 01/64] Update Hints.as --- popForm/Hints.as | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/popForm/Hints.as b/popForm/Hints.as index b5751b7..b24aa6f 100644 --- a/popForm/Hints.as +++ b/popForm/Hints.as @@ -32,6 +32,8 @@ private static var onWaitClosedUserFunctoin:Function ; private static var _onClose:Function; + + public static var addButtonsOnSingleLine:Boolean = true ; public static function get isOpen():Boolean { @@ -63,7 +65,7 @@ controllConfig(); var buttons:Array = [new PopButtonData(Contents.lang.t[id_yes],ButtonFrameYes,null,true,true) - ,new PopButtonData(Contents.lang.t[id_no],ButtonFrameNo,null,true,true)] ; + ,new PopButtonData(Contents.lang.t[id_no],ButtonFrameNo,null,true,addButtonsOnSingleLine)] ; var popFields:PopMenuFields; if(descriptionFieldLines>0) { From 313ad6a42742f541e91d045226a931f0a0c1aedd Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Mon, 19 Oct 2020 14:40:14 +0330 Subject: [PATCH 02/64] required flag on PopFields --- popForm/PopField.as | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/popForm/PopField.as b/popForm/PopField.as index b476ca1..fca7e8f 100644 --- a/popForm/PopField.as +++ b/popForm/PopField.as @@ -69,6 +69,8 @@ private var onSubmited:Function ; private var onEditedFunc:Function ; private var onEditeFuncCalDelay:uint ; + + private var requiredMC:MovieClip ; public function get textField():TextField @@ -185,6 +187,13 @@ { super(); stop(); + requiredMC = Obj.get("required_mc",this); + if(requiredMC)requiredMC.visible = false ; + } + + public function required():void + { + if(requiredMC)requiredMC.visible = true ; } /**Changing the form color without making effect on other values*/ From a9b93b7944011e4749d36afe663e39c60c2fab00 Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Mon, 19 Oct 2020 14:40:47 +0330 Subject: [PATCH 03/64] PopMenu debugged --- popForm/PopMenu.as | 14 +++++++++----- popForm/PopMenuContenDisplay.as | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/popForm/PopMenu.as b/popForm/PopMenu.as index e3df4c0..26adfcf 100644 --- a/popForm/PopMenu.as +++ b/popForm/PopMenu.as @@ -28,6 +28,8 @@ import flash.geom.Matrix; import flash.utils.setTimeout; import contents.Contents; + import flash.display.DisplayObject; + import contents.alert.Alert; public class PopMenu extends MovieClip { @@ -95,7 +97,7 @@ private var cancelButton:MovieClip; /**Enter a String or an Array of Strings*/ - public static function backEnable(backString:*) + public static function backEnable(backString:*):void { backButtonName = backString ; } @@ -104,7 +106,7 @@ public static function staticCanselEnabled(CancelNames:Array):void { cancelNames = CancelNames.concat() ; - for(var i = 0 ; i(); From 533b2cb01d0ee549c890b1cc465d67f1214ef769 Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Mon, 19 Oct 2020 14:41:09 +0330 Subject: [PATCH 04/64] WebServiceCaller debugged --- webService/webCallers/WebServiceCaller.as | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webService/webCallers/WebServiceCaller.as b/webService/webCallers/WebServiceCaller.as index ce2b9bc..cfb4f49 100644 --- a/webService/webCallers/WebServiceCaller.as +++ b/webService/webCallers/WebServiceCaller.as @@ -262,10 +262,10 @@ connected = true ; cansel(); generateDataAndDispatchEvent(e.pureData); - if(func_onDataRetrived!=null) + /*if(func_onDataRetrived!=null) { func_onDataRetrived(); - } + }*/ this.dispatchEvent(new Event(Event.CONNECT)); } } From 303b50b9c5d37f4888d8e4cc75487a8769a3f405 Mon Sep 17 00:00:00 2001 From: Mohammad Ebrahim Sepehr Date: Tue, 27 Oct 2020 07:00:26 +0330 Subject: [PATCH 05/64] get cameraroll permission before save command --- photoEditor/PhotoEdit.as | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/photoEditor/PhotoEdit.as b/photoEditor/PhotoEdit.as index 4048a72..b831db1 100644 --- a/photoEditor/PhotoEdit.as +++ b/photoEditor/PhotoEdit.as @@ -288,8 +288,7 @@ { if(AutoSaveOnDevice && CameraRoll.supportsAddBitmapData) { - var imageSaver:CameraRoll = new CameraRoll(); - imageSaver.addBitmapData(image); + DeviceImage.saveImageToGallery(image,new Function()) } onDone(); ME.disable(); @@ -297,7 +296,7 @@ internal static function close(e:*=null):void { - for(var i = 0 ; i Date: Mon, 2 Nov 2020 14:55:33 +0330 Subject: [PATCH 06/64] Update PageContainer.as --- appManager/animatedPages/pageManager/PageContainer.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appManager/animatedPages/pageManager/PageContainer.as b/appManager/animatedPages/pageManager/PageContainer.as index 022ff3f..2e8ba75 100644 --- a/appManager/animatedPages/pageManager/PageContainer.as +++ b/appManager/animatedPages/pageManager/PageContainer.as @@ -105,7 +105,7 @@ package appManager.animatedPages.pageManager } //auto size detector on horizontal >< position had bug, if you set it true, the scroll will lock anyway - scrollerMC = new ScrollMT(currentPage,AppWithContent.contentRect,targetArea,autoSizeDetector,false/*autoSizeDetector*/,currentPageData.scrollEffect,false); + scrollerMC = new ScrollMT(currentPage,Contents.config.pageRectXY0,targetArea,autoSizeDetector,false/*autoSizeDetector*/,currentPageData.scrollEffect,false); } if(myEvent is AppEventContent) From 51ca42e833a014749ff5e7e60e07b170c8e5bb2b Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Mon, 2 Nov 2020 14:55:47 +0330 Subject: [PATCH 07/64] Update PopButton.as --- popForm/PopButton.as | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/popForm/PopButton.as b/popForm/PopButton.as index 9b5b8fd..60b0de8 100644 --- a/popForm/PopButton.as +++ b/popForm/PopButton.as @@ -234,14 +234,16 @@ } } - public function onClick(func:Function):void + public function onClick(func:Function):PopButton { Obj.setButton(this,func); + return this ; } - public function onClickOpenLink(link:LinkData):void + public function onClickOpenLink(link:LinkData):PopButton { Obj.setButton(this,openLink); _link_to_open = link ; + return this ; } private function openLink():void { @@ -249,13 +251,14 @@ this.dispatchEvent(new AppEventContent(_link_to_open)); } - public function setUpByLink(linkData:LinkData):void + public function setUpByLink(linkData:LinkData):PopButton { setUp(linkData.name); var ME:PopButton = this ; onClick(function():void{ ME.dispatchEvent(new AppEventContent(linkData)); }); + return this ; } From 3fd302d32566e02f7d0ec677647925ff4d0564b4 Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Mon, 2 Nov 2020 14:56:01 +0330 Subject: [PATCH 08/64] isCurrentcy() function on PopFields --- popForm/PopField.as | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/popForm/PopField.as b/popForm/PopField.as index fca7e8f..9604a94 100644 --- a/popForm/PopField.as +++ b/popForm/PopField.as @@ -191,9 +191,16 @@ if(requiredMC)requiredMC.visible = false ; } - public function required():void + public function required():PopField { if(requiredMC)requiredMC.visible = true ; + return this ; + } + + public function isCurrentcy():PopField + { + if(nativeKeyBoard)nativeKeyBoard.isCurrency() + return this ; } /**Changing the form color without making effect on other values*/ From baed23a70eb938ffda421b095506ed1d2a412e19 Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Mon, 2 Nov 2020 14:56:14 +0330 Subject: [PATCH 09/64] Google map updated --- nativeClasses/map/DistriqtGoogleMap.as | 126 ++++++++++++++----------- 1 file changed, 70 insertions(+), 56 deletions(-) diff --git a/nativeClasses/map/DistriqtGoogleMap.as b/nativeClasses/map/DistriqtGoogleMap.as index 8ca42db..d89a64a 100644 --- a/nativeClasses/map/DistriqtGoogleMap.as +++ b/nativeClasses/map/DistriqtGoogleMap.as @@ -1,54 +1,38 @@ package nativeClasses.map { - //import com.distriqt.extension.nativemaps.AuthorisationStatus; - //import com.distriqt.extension.nativemaps.NativeMaps; - //import com.distriqt.extension.nativemaps.events.NativeMapEvent; - //import com.distriqt.extension.nativemaps.objects.CustomMarkerIcon; - //import com.distriqt.extension.nativemaps.objects.LatLng; - //import com.distriqt.extension.nativemaps.objects.MapMarker; - //import com.distriqt.extension.nativemaps.objects.MapType; - - import com.mteamapp.StringFunctions; - + import flash.display.Sprite; import flash.events.Event; import flash.events.EventDispatcher; - import flash.filesystem.File; import flash.geom.Rectangle; import flash.utils.getDefinitionByName; import flash.utils.setTimeout; import stageManager.StageManager; import flash.display.StageScaleMode; - import com.distriqt.extension.nativemaps.NativeMaps; - import com.distriqt.extension.nativemaps.objects.MapStyleOptions; import flash.display.BitmapData; import flash.display.Bitmap; - import com.distriqt.extension.nativemaps.events.NativeMapBitmapEvent; - import com.distriqt.extension.nativemaps.events.NativeMapEvent; - import com.distriqt.extension.nativemaps.objects.MapMarker; - import com.distriqt.extension.nativemaps.objects.LatLng; - import com.distriqt.extension.nativemaps.objects.CustomMarkerIcon; - import flash.utils.getTimer; import flash.geom.Point; public class DistriqtGoogleMap extends Sprite { - /**com.distriqt.extension.nativemaps.AuthorisationStatus*/ + /**com.distriqt.extension.application.AuthorisationStatus*/ private static var AuthorisationStatusClass:Class ; - /**com.distriqt.extension.nativemaps.NativeMaps*/ + /**com.distriqt.extension.application.NativeMaps*/ private static var NativeMapsClass:Class ; - /**com.distriqt.extension.nativemaps.events.NativeMapEvent*/ + /**com.distriqt.extension.application.events.NativeMapEvent*/ private static var NativeMapEventClass:Class ; - /**com.distriqt.extension.nativemaps.objects.CustomMarkerIcon*/ + /*com.distriqt.extension.nativemaps.events.NativeMapBitmapEvent*/ + private static var NativeMapBitmapEventClass:Class ; + /**com.distriqt.extension.application.objects.CustomMarkerIcon*/ private static var CustomMarkerIconClass:Class ; - /**com.distriqt.extension.nativemaps.objects.LatLng*/ + /**com.distriqt.extension.application.objects.LatLng*/ private static var LatLngClass:Class ; - /**com.distriqt.extension.nativemaps.objects.MapMarker*/ + /**com.distriqt.extension.application.objects.MapMarker*/ private static var MapMarkerClass:Class ; - /**import com.distriqt.extension.nativemaps.objects.MapStyleOptions*/ + /**import com.distriqt.extension.application.objects.MapStyleOptions*/ private static var MapStyleOptionsClass:Class; - /**com.distriqt.extension.nativemaps.objects.MapType*/ + /**com.distriqt.extension.application.objects.MapType*/ private static var MapTypeClass:Class ; private static var defaultZoomLevel:uint = 15; @@ -96,12 +80,13 @@ public static function setUp(GoogleAPIKey:String=null,DistriqtId:String=null):void { //SaffronLogger.log('*********GoogleAPIKey*******'+GoogleAPIKey); - + if(isSupports==true)return; try { - AuthorisationStatusClass = getDefinitionByName("com.distriqt.extension.nativemaps.AuthorisationStatus") as Class ; - NativeMapsClass = NativeMaps;//getDefinitionByName("com.distriqt.extension.nativemaps.NativeMaps") as Class ; + AuthorisationStatusClass = getDefinitionByName("com.distriqt.extension.application.AuthorisationStatus") as Class ; + NativeMapsClass = getDefinitionByName("com.distriqt.extension.nativemaps.NativeMaps") as Class ; NativeMapEventClass = getDefinitionByName("com.distriqt.extension.nativemaps.events.NativeMapEvent") as Class ; + NativeMapBitmapEventClass = getDefinitionByName("com.distriqt.extension.nativemaps.events.NativeMapBitmapEvent") as Class ; CustomMarkerIconClass = getDefinitionByName("com.distriqt.extension.nativemaps.objects.CustomMarkerIcon") as Class ; LatLngClass = getDefinitionByName("com.distriqt.extension.nativemaps.objects.LatLng") as Class ; MapMarkerClass = getDefinitionByName("com.distriqt.extension.nativemaps.objects.MapMarker") as Class ; @@ -173,6 +158,7 @@ { counter++; super(); + setUp(); dispatcher.dispatchEvent(new Event(Event.REMOVED_FROM_STAGE)); unload(); @@ -185,6 +171,23 @@ this.addEventListener(Event.REMOVED_FROM_STAGE,unload); dispatcher.addEventListener(Event.REMOVED_FROM_STAGE,removeMeBecauseSomeOneElseComes); } + + override public function set visible(value:Boolean):void + { + super.visible = value ; + + try + { + if(value) + (NativeMapsClass as Object).service.showMap(); + else + (NativeMapsClass as Object).service.hideMap(); + } + catch(e:Error) + { + trace(e.message); + } + } protected function removeMeBecauseSomeOneElseComes(event:Event):void { @@ -198,6 +201,8 @@ public function setMap(centerLat:Number=NaN,centerLon:Number=NaN,icons:Vector.=null,zoomLevel:Number=-1,mapStyleJSON:String=null,showUserLocation:Boolean=false):void { + if(!isSupports) + return; map_style = mapStyleJSON ; user_location = showUserLocation ; //unload(); @@ -240,37 +245,42 @@ firstZoomLevel = zoomLevel<0?defaultZoomLevel:zoomLevel ; SaffronLogger.log("...listenning..."); (NativeMapsClass as Object).service.addEventListener( (NativeMapEventClass as Object).MAP_CREATED, mapCreatedHandler ); - (NativeMapsClass as Object).service.addEventListener( NativeMapBitmapEvent.READY , updateCapturedBitmap); + (NativeMapsClass as Object).service.addEventListener( (NativeMapBitmapEventClass as Object).READY , updateCapturedBitmap); SaffronLogger.log("---Creating..."); - NativeMaps.service.createMap( rect, (MapTypeClass as Object).MAP_TYPE_NORMAL,new LatLng(centerLat,centerLon),firstZoomLevel); - + (NativeMapsClass as Object).service.createMap( rect, (MapTypeClass as Object).MAP_TYPE_NORMAL,new LatLngClass(centerLat,centerLon),firstZoomLevel); + if(!super.visible) + (NativeMapsClass as Object).service.hideMap(); SaffronLogger.log("Create map done"); mapCreated = true ; mapIsShowing = true ; } + else + { + SaffronLogger.log("Google map is not support"); + } this.addEventListener(Event.ENTER_FRAME,repose,false,10000); } - private var centerMarker:MapMarker, - centerMarkerPosition:LatLng, + private var centerMarker:*, + centerMarkerPosition:*, centerMarkerId:uint, - centerMarkerIcon:CustomMarkerIcon ; + centerMarkerIcon:* ; public function setAPinOnCenter(iconBitmap:BitmapData,centerName:String):void { const iconName:String = centerName; - centerMarkerIcon = new CustomMarkerIcon( iconName ) + centerMarkerIcon = new CustomMarkerIconClass( iconName ) .setImage( iconBitmap ) .setCenterOffset( 0, -iconBitmap.height ); - centerMarkerPosition = NativeMaps.service.getCentre(); + centerMarkerPosition = (NativeMapsClass as Object).service.getCentre(); if(centerMarker!=null) { - NativeMaps.service.removeMarker(centerMarkerId); + (NativeMapsClass as Object).service.removeMarker(centerMarkerId); } - centerMarker = new MapMarker(centerName,centerMarkerPosition,centerName,'',0,false,false,true,false,iconName); + centerMarker = new MapMarkerClass(centerName,centerMarkerPosition,centerName,'',0,false,false,true,false,iconName); if(mapCretedOnStage) { updateCenterMarker(); @@ -286,9 +296,9 @@ try { - NativeMaps.service.addCustomMarkerIcon(centerMarkerIcon); + (NativeMapsClass as Object).service.addCustomMarkerIcon(centerMarkerIcon); }catch(e:Error){} - centerMarkerId = NativeMaps.service.addMarker( centerMarker ); + centerMarkerId = (NativeMapsClass as Object).service.addMarker( centerMarker ); } private function updateCapturedBitmap(e:*):void @@ -309,7 +319,8 @@ dispatcher.removeEventListener(Event.REMOVED_FROM_STAGE,removeMeBecauseSomeOneElseComes); this.removeEventListener(Event.ENTER_FRAME,repose); - NativeMaps.service.dispose(); + if(NativeMapsClass!=null) + (NativeMapsClass as Object).service.dispose(); } private function mapCreatedHandler(e:*):void @@ -323,7 +334,7 @@ setMapStyle(); - NativeMaps.service.showUserLocation(user_location); + (NativeMapsClass as Object).service.showUserLocation(user_location); updateMarkers(); updateCenterMarker(); @@ -336,14 +347,14 @@ /*forceToHideMap = true ; repose(null); (NativeMapsClass as Object).service.addEventListener( (NativeMapEvent).MAP_RENDER_COMPLETE, showMapAgain );*/ - var styleOption:MapStyleOptions = new MapStyleOptions(map_style); - NativeMaps.service.setMapStyle(styleOption); + var styleOption:* = new MapStyleOptionsClass(map_style); + (NativeMapsClass as Object).service.setMapStyle(styleOption); } } private function showMapAgain(e:*):void { - (NativeMapsClass as Object).service.removeEventListener( (NativeMapEvent).MAP_RENDER_COMPLETE, showMapAgain ); + (NativeMapsClass as Object).service.removeEventListener( (NativeMapEventClass).MAP_RENDER_COMPLETE, showMapAgain ); forceToHideMap = false ; } @@ -353,7 +364,7 @@ SaffronLogger.log("******* first center is : "+lat,lon,zoomLevel); center = new LatLngClass(lat,lon); firstZoomLevel = zoomLevel<=0?defaultZoomLevel:zoomLevel ; - NativeMaps.service.setCentre(center as LatLng,firstZoomLevel,animationDuration!=0,animationDuration) + (NativeMapsClass as Object).service.setCentre(center/* as LatLng*/,firstZoomLevel,animationDuration!=0,animationDuration) } private function createViewPort():Rectangle @@ -399,8 +410,8 @@ //SaffronLogger.log("Old rect : " +rect); //SaffronLogger.log("scl : "+scl); - SaffronLogger.log("deltaX : "+deltaX); - SaffronLogger.log("deltaY : "+deltaY); + //SaffronLogger.log("deltaX : "+deltaX); + //SaffronLogger.log("deltaY : "+deltaY); rect.x*=scl; rect.y*=scl; @@ -477,7 +488,7 @@ { //SaffronLogger.log("!!!!!!!!!!!!!!!hide!!!!!!!!!!!!!!!"); (NativeMapsClass as Object).service.hideMap(); - NativeMaps.service.requestMapBitmapData(); + (NativeMapsClass as Object).service.requestMapBitmapData(); mapIsShowing = false ; catchedBitmap.visible = true ; } @@ -485,7 +496,7 @@ if(centerMarker!=null) { - var cent:LatLng = NativeMaps.service.getCentre() ; + var cent:* = (NativeMapsClass as Object).service.getCentre() ; if(centerMarkerPosition==null) { centerMarkerPosition = cent ; @@ -495,13 +506,13 @@ centerMarkerPosition.lat = centerMarkerPosition.lat+(cent.lat-centerMarkerPosition.lat)/2; centerMarkerPosition.lon = centerMarkerPosition.lon+(cent.lon-centerMarkerPosition.lon)/2; centerMarker.setPosition(centerMarkerPosition); - NativeMaps.service.updateMarker(centerMarker); + (NativeMapsClass as Object).service.updateMarker(centerMarker); } } public function centerPosition():Point { - var cent:LatLng = NativeMaps.service.getCentre() ; + var cent:* = (NativeMapsClass as Object).service.getCentre() ; if(cent!=null) return new Point(cent.lat,cent.lon); return new Point(0,0); @@ -509,6 +520,9 @@ public function addMarker(markerName:String,lat:Number,lon:Number,markerTitle:String,markerInfo:String,color:uint=0,enableInfoWindow:Boolean=true,animated:Boolean=true,showInfoButton:Boolean=true,iconId:String=''):void { + setUp(); + if(!isSupports) + return; //Alert.show("****************Map marker Added : ",lat,lon,markerName,'iconId : '+iconId); var myMarker:Object = new MapMarkerClass(markerName,new LatLngClass(lat,lon),markerTitle,markerInfo,color,false,enableInfoWindow,animated,showInfoButton,iconId) myMarkers.push(myMarker); @@ -526,7 +540,7 @@ public function zoomLevel():Number { - return NativeMaps.service.getZoom(); + return (NativeMapsClass as Object).service.getZoom(); } private function updateMarkers():void @@ -554,7 +568,7 @@ for(i = 0 ; i(); } From a4534f3b78e5b3d3712c017196433aedd006f679 Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Wed, 4 Nov 2020 13:29:39 +0330 Subject: [PATCH 10/64] Map upgraded to capture MarkerItem clicks --- nativeClasses/map/DistriqtGoogleMap.as | 36 +++++++++++++++++++++++--- nativeClasses/map/MarkerItem.as | 33 +++++++++++++++++++++++ 2 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 nativeClasses/map/MarkerItem.as diff --git a/nativeClasses/map/DistriqtGoogleMap.as b/nativeClasses/map/DistriqtGoogleMap.as index d89a64a..4711f87 100644 --- a/nativeClasses/map/DistriqtGoogleMap.as +++ b/nativeClasses/map/DistriqtGoogleMap.as @@ -64,6 +64,7 @@ /**myMarkers is an array of MapMarker*/ private var myMarkers:Vector., + markerItemsList:Vector. = new Vector.(), myIcons:Vector.; private var mapCretedOnStage:Boolean; @@ -246,6 +247,7 @@ SaffronLogger.log("...listenning..."); (NativeMapsClass as Object).service.addEventListener( (NativeMapEventClass as Object).MAP_CREATED, mapCreatedHandler ); (NativeMapsClass as Object).service.addEventListener( (NativeMapBitmapEventClass as Object).READY , updateCapturedBitmap); + (NativeMapsClass as Object).service.addEventListener((NativeMapEventClass as Object).MARKER_TOUCHED,getTouchedItem); SaffronLogger.log("---Creating..."); (NativeMapsClass as Object).service.createMap( rect, (MapTypeClass as Object).MAP_TYPE_NORMAL,new LatLngClass(centerLat,centerLon),firstZoomLevel); if(!super.visible) @@ -261,6 +263,17 @@ this.addEventListener(Event.ENTER_FRAME,repose,false,10000); } + private function getTouchedItem(e:*):void + { + for(var i:int = 0 ; i(); } private function mapCreatedHandler(e:*):void @@ -361,6 +375,8 @@ public function setCenter(lat:Number,lon:Number,zoomLevel:Number=-1,animationDuration:uint=2000):void { + setUp(); + if(isSupports==false)return; SaffronLogger.log("******* first center is : "+lat,lon,zoomLevel); center = new LatLngClass(lat,lon); firstZoomLevel = zoomLevel<=0?defaultZoomLevel:zoomLevel ; @@ -518,11 +534,14 @@ return new Point(0,0); } - public function addMarker(markerName:String,lat:Number,lon:Number,markerTitle:String,markerInfo:String,color:uint=0,enableInfoWindow:Boolean=true,animated:Boolean=true,showInfoButton:Boolean=true,iconId:String=''):void + /**Be carefull to user a unique name as marekrName */ + public function addMarker(markerName:String,lat:Number,lon:Number,markerTitle:String,markerInfo:String,color:uint=0,enableInfoWindow:Boolean=true,animated:Boolean=true,showInfoButton:Boolean=true,iconId:String=''):MarkerItem { setUp(); + var markerItem:MarkerItem = new MarkerItem(markerName); + markerItemsList.push(markerItem); if(!isSupports) - return; + return markerItem; //Alert.show("****************Map marker Added : ",lat,lon,markerName,'iconId : '+iconId); var myMarker:Object = new MapMarkerClass(markerName,new LatLngClass(lat,lon),markerTitle,markerInfo,color,false,enableInfoWindow,animated,showInfoButton,iconId) myMarkers.push(myMarker); @@ -530,6 +549,7 @@ { updateMarkers(); } + return markerItem ; } public function style(style:String):void @@ -567,8 +587,18 @@ myIcons = new Vector.(); for(i = 0 ; i(); } diff --git a/nativeClasses/map/MarkerItem.as b/nativeClasses/map/MarkerItem.as new file mode 100644 index 0000000..97a3bfa --- /dev/null +++ b/nativeClasses/map/MarkerItem.as @@ -0,0 +1,33 @@ +package nativeClasses.map +{ + public class MarkerItem + { + internal var id:int; + + + public var name:String ; + + private var _onClick:Function ; + + public function MarkerItem(markerName:String) + { + name = markerName ; + } + + public function dispatchClicked():void + { + if(_onClick!=null) + { + if(_onClick.length==0) + _onClick(); + else + _onClick(this); + } + } + + public function onClick(event:Function):void + { + _onClick = event ; + } + } +} \ No newline at end of file From d9d9bfeb4c7456472981946adb018e778a34a991 Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Sun, 8 Nov 2020 11:33:12 +0330 Subject: [PATCH 11/64] Update DistriqtGoogleMap.as --- nativeClasses/map/DistriqtGoogleMap.as | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/nativeClasses/map/DistriqtGoogleMap.as b/nativeClasses/map/DistriqtGoogleMap.as index 4711f87..9aa8ecb 100644 --- a/nativeClasses/map/DistriqtGoogleMap.as +++ b/nativeClasses/map/DistriqtGoogleMap.as @@ -263,6 +263,11 @@ this.addEventListener(Event.ENTER_FRAME,repose,false,10000); } + public function isCreated():Boolean + { + return mapCreated ; + } + private function getTouchedItem(e:*):void { for(var i:int = 0 ; i(); + if(super.visible==false)(NativeMapsClass as Object).service.hideMap(); } } } \ No newline at end of file From c8b1b0ff8ac979335d7f6f99b609cb0adfc19a2a Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Sun, 8 Nov 2020 11:33:37 +0330 Subject: [PATCH 12/64] Throw more errors on debugging mode --- .../animatedPages/pageManager/PageContainer.as | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/appManager/animatedPages/pageManager/PageContainer.as b/appManager/animatedPages/pageManager/PageContainer.as index 2e8ba75..1e1d1cb 100644 --- a/appManager/animatedPages/pageManager/PageContainer.as +++ b/appManager/animatedPages/pageManager/PageContainer.as @@ -71,8 +71,8 @@ package appManager.animatedPages.pageManager if(pageClassType != null) { - /*try - {*/ + try + { currentPage = new pageClassType(); pageReadyDispatched = false ; var framesList:Array = currentPage.currentLabels; @@ -85,12 +85,14 @@ package appManager.animatedPages.pageManager middleFrame = currentPage.totalFrames ; } finishFrame = currentPage.totalFrames ; - /*} - catch(e) + } + catch(e:Error) { + if(DevicePrefrence.isDebuggingMode()) + throw e ; SaffronLogger.log("Page is not generated : "+e); return; - }*/ + } SaffronLogger.log("*** currentPage added to stage"); this.addChild(currentPage); From b73a8963a0ba6eac28a1c768bef8ee9736f86bf6 Mon Sep 17 00:00:00 2001 From: mahooresorkh Date: Tue, 10 Nov 2020 12:15:22 +0330 Subject: [PATCH 13/64] Update DistriqtGoogleMap.as --- nativeClasses/map/DistriqtGoogleMap.as | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nativeClasses/map/DistriqtGoogleMap.as b/nativeClasses/map/DistriqtGoogleMap.as index 9aa8ecb..caca4ca 100644 --- a/nativeClasses/map/DistriqtGoogleMap.as +++ b/nativeClasses/map/DistriqtGoogleMap.as @@ -577,11 +577,11 @@ { //(NativeMapsClass as Object).service.clearMap(); - var i:int ; + var i:int, j:int ; var isDuplicated:Boolean = false ; for(i = 0 ; i Date: Tue, 17 Nov 2020 09:25:33 +0330 Subject: [PATCH 14/64] Do not cancel onLoad and onError after reload function called --- restDoaService/RestDoaServiceCaller.as | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/restDoaService/RestDoaServiceCaller.as b/restDoaService/RestDoaServiceCaller.as index f16bcec..a8620cc 100644 --- a/restDoaService/RestDoaServiceCaller.as +++ b/restDoaService/RestDoaServiceCaller.as @@ -455,10 +455,10 @@ } /**Values are not case sencitive*/ - protected function loadParam(obj:Object=null,isDataForm:Boolean=false):void + protected function loadParam(obj:Object=null,isDataForm:Boolean=false,clearFunctions:Boolean=true):void { HTTPStatus = 0 ; - cansel(); + cansel(clearFunctions); updateHeaders(); isConnected = false ; onUpdateProccess = false ; @@ -587,13 +587,14 @@ //noInternet(); } - public function reLoad(delay:uint=20000,dontReturnOfflineData:Boolean=false):void + public function reLoad(delay:uint=20000,dontReturnOfflineData:Boolean=false):RestDoaServiceCaller { cansel(false); offlineDate = new Date() ; offlineDataIsOK = !dontReturnOfflineData ; instantOfflineData = false ; - timerId = setTimeout(loadParam,delay) + timerId = setTimeout(loadParam,delay,null,false,false); + return this ; } public function cancel():void From 7f96db3026a6f25fbb4b52d11bbf72a5236bb030 Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Tue, 17 Nov 2020 09:25:56 +0330 Subject: [PATCH 15/64] No need to update VersionTracer every 2 seconds --- appManager/displayContentElemets/VersionTracer.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appManager/displayContentElemets/VersionTracer.as b/appManager/displayContentElemets/VersionTracer.as index cbee477..27a10f0 100644 --- a/appManager/displayContentElemets/VersionTracer.as +++ b/appManager/displayContentElemets/VersionTracer.as @@ -31,7 +31,7 @@ package appManager.displayContentElemets { if(this.stage!=null) { - intervalId = setInterval(updateVersionLabel,2000); + intervalId = setInterval(updateVersionLabel,10000); this.addEventListener(Event.REMOVED_FROM_STAGE,unLoad); } else From 112b469d78a65f6f7e9600e881ba954286d8a149 Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Tue, 17 Nov 2020 09:26:10 +0330 Subject: [PATCH 16/64] DynamicLink pageId problem solved --- contents/displayPages/DynamicLinks.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contents/displayPages/DynamicLinks.as b/contents/displayPages/DynamicLinks.as index 9f007c5..1a6adf1 100644 --- a/contents/displayPages/DynamicLinks.as +++ b/contents/displayPages/DynamicLinks.as @@ -733,7 +733,7 @@ package contents.displayPages if(linksContainer!=null && myPageData!=null && myPageData.id!='') { - if(myPageData.id!='') + if(myPageData.id!='' && myPageData.id!=null) { if(horizontalMenu) { From fe261945d320c85814604ede99c03b834ba81de7 Mon Sep 17 00:00:00 2001 From: Younes Mashayekhi Date: Tue, 8 Dec 2020 11:05:04 +0330 Subject: [PATCH 17/64] Update DynamicLinks.as --- contents/displayPages/DynamicLinks.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contents/displayPages/DynamicLinks.as b/contents/displayPages/DynamicLinks.as index 1a6adf1..7afa1cf 100644 --- a/contents/displayPages/DynamicLinks.as +++ b/contents/displayPages/DynamicLinks.as @@ -368,7 +368,7 @@ package contents.displayPages /**Start controlling mouse down*/ protected function controllMouseSlide(event:MouseEvent):void { - linkScroller.isInRange(); + if(linkScroller)linkScroller.isInRange(); SaffronLogger.log("Mouse clicked"); var itemY:Number ; var currentLinkItem:LinkItem ; From 716afe3ecb9e20c7bab32aa70a3a17971b88fad9 Mon Sep 17 00:00:00 2001 From: Younes Mashayekhi Date: Wed, 16 Dec 2020 18:28:29 +0330 Subject: [PATCH 18/64] Update DistriqtPushNotification.as --- .../DistriqtPushNotification.as | 463 ++++++++---------- 1 file changed, 214 insertions(+), 249 deletions(-) diff --git a/nativeClasses/pushNotification/DistriqtPushNotification.as b/nativeClasses/pushNotification/DistriqtPushNotification.as index 1fbc23f..fee95eb 100644 --- a/nativeClasses/pushNotification/DistriqtPushNotification.as +++ b/nativeClasses/pushNotification/DistriqtPushNotification.as @@ -1,257 +1,222 @@ -package nativeClasses.pushNotification -{ - /*import com.distriqt.extension.core.Core; - import com.distriqt.extension.pushnotifications.AuthorisationStatus; - import com.distriqt.extension.pushnotifications.PushNotifications; - import com.distriqt.extension.pushnotifications.Service; - import com.distriqt.extension.pushnotifications.builders.ActionBuilder; - import com.distriqt.extension.pushnotifications.builders.CategoryBuilder; - import com.distriqt.extension.pushnotifications.builders.ChannelBuilder; - import com.distriqt.extension.pushnotifications.events.AuthorisationEvent; - import com.distriqt.extension.pushnotifications.events.RegistrationEvent;*/ - import flash.utils.getDefinitionByName; - import contents.alert.Alert; - //import com.distriqt.extension.pushnotifications.events.PushNotificationEvent; - //import com.distriqt.extension.pushnotifications.events.PushNotificationGroupEvent; - /** - * ... - * @author Younes Mashayekhi - */ - public class DistriqtPushNotification - { - public static var deviceToken:String; - public static var CoreClass:Class; - public static var AuthorisationStatusClass:Class; - public static var PushNotificationsClass:Class; - public static var ServiceClass:Class; - public static var ActionBuilderClass:Class; - public static var CategoryBuilderClass:Class; - public static var ChannelBuilderClass:Class; - public static var AuthorisationEventClass:Class; - public static var RegistrationEventClass:Class; - /**com.distriqt.extension.pushnotifications.events.PushNotificationEvent */ - public static var PushNotificationEventClass:Class; - /**com.distriqt.extension.pushnotifications.events.PushNotificationGroupEvent */ - public static var PushNotificationGroupEventClass:Class; +package nativeClasses.pushNotification { + /*import com.distriqt.extension.core.Core; + import com.distriqt.extension.pushnotifications.AuthorisationStatus; + import com.distriqt.extension.pushnotifications.PushNotifications; + import com.distriqt.extension.pushnotifications.Service; + import com.distriqt.extension.pushnotifications.builders.ActionBuilder; + import com.distriqt.extension.pushnotifications.builders.CategoryBuilder; + import com.distriqt.extension.pushnotifications.builders.ChannelBuilder; + import com.distriqt.extension.pushnotifications.events.AuthorisationEvent; + import com.distriqt.extension.pushnotifications.events.RegistrationEvent;*/ + import flash.utils.getDefinitionByName; + import contents.alert.Alert; + //import com.distriqt.extension.pushnotifications.events.PushNotificationEvent; + //import com.distriqt.extension.pushnotifications.events.PushNotificationGroupEvent; + /** + * ... + * @author Younes Mashayekhi + */ + public class DistriqtPushNotification { + public static var deviceToken:String; + public static var CoreClass:Class; + public static var AuthorisationStatusClass:Class; + public static var PushNotificationsClass:Class; + public static var ServiceClass:Class; + public static var ActionBuilderClass:Class; + public static var CategoryBuilderClass:Class; + public static var ChannelBuilderClass:Class; + public static var AuthorisationEventClass:Class; + public static var RegistrationEventClass:Class; + /**com.distriqt.extension.pushnotifications.events.PushNotificationEvent */ + public static var PushNotificationEventClass:Class; + /**com.distriqt.extension.pushnotifications.events.PushNotificationGroupEvent */ + public static var PushNotificationGroupEventClass:Class; - private static var NotifReceived:Function ; - - public function DistriqtPushNotification() - { - - } - - public static function loadClasses():void - { - if (PushNotificationsClass == null) - { - try - { - CoreClass = getDefinitionByName("com.distriqt.extension.core.Core") as Class; - AuthorisationStatusClass = getDefinitionByName("com.distriqt.extension.pushnotifications.AuthorisationStatus") as Class; - PushNotificationsClass = getDefinitionByName("com.distriqt.extension.pushnotifications.PushNotifications") as Class; - ServiceClass = getDefinitionByName("com.distriqt.extension.pushnotifications.Service") as Class; - ActionBuilderClass = getDefinitionByName("com.distriqt.extension.pushnotifications.builders.ActionBuilder") as Class; - CategoryBuilderClass = getDefinitionByName("com.distriqt.extension.pushnotifications.builders.CategoryBuilder") as Class; - ChannelBuilderClass = getDefinitionByName("com.distriqt.extension.pushnotifications.builders.ChannelBuilder") as Class; - AuthorisationEventClass = getDefinitionByName("com.distriqt.extension.pushnotifications.events.AuthorisationEvent") as Class; - RegistrationEventClass = getDefinitionByName("com.distriqt.extension.pushnotifications.events.RegistrationEvent") as Class; - PushNotificationEventClass = getDefinitionByName("com.distriqt.extension.pushnotifications.events.PushNotificationEvent") as Class; - PushNotificationGroupEventClass = getDefinitionByName("com.distriqt.extension.pushnotifications.events.PushNotificationGroupEvent") as Class; - SaffronLogger.log("RegistrationEventClass : "+RegistrationEventClass); - } - catch (e) - { - SaffronLogger.log('Add \n\n\tcom.distriqt.PushNotification\n\tcom.distriqt.Core\n\n to your project xmls');// and below permitions to the tag : \n\n\n\n\t\n\n\n\n\t\n\n'; - } - } - } - - public static function isSupport():Boolean - { - loadClasses(); - if (PushNotificationsClass == null || PushNotificationsClass.isSupported == false) - return false - else - return true; - } - - /** - * You can receive server data on onNotifReceived function as a String - * @param onResult - * @param onNotifReceived - */ - public static function setup(onResult:Function = null,onNotifReceived:Function=null):void - { - NotifReceived = onNotifReceived ; - var PushNotifications:Object; - loadClasses(); - if(onResult==null) - { - onResult = function(text:String):void - { - //show registration ID : - SaffronLogger.log(text); - } - } - if (PushNotificationsClass == null) - { - SaffronLogger.log("push notification is null"); - deviceToken = "windowsDebug"; - onResult(deviceToken); - return; - } - try - { - if (PushNotificationsClass.isSupported) - { - SaffronLogger.log("Push Notification supported") - if ((PushNotificationsClass as Object).service.isServiceSupported((ServiceClass as Object).FCM)) - { - var service:* = new ServiceClass((ServiceClass as Object).FCM, ""); - service.sandboxMode = false; - service.enableNotificationsWhenActive = true; - service.categories.push(new CategoryBuilderClass().setIdentifier("MESSAGE_CATEGORY").addAction(new ActionBuilderClass().setTitle("OK").setWillLaunchApplication(true).setIdentifier("OPEN_APP_BTN").build()).addAction(new ActionBuilderClass().setTitle("Cancel").setDestructive(true).setShouldCancelOnAction(true).setIdentifier("CANCEL_APP_BTN").build()).build()); - service.channels.push(new ChannelBuilderClass().setId("app_channel").setName("App Channel").build()); - (PushNotificationsClass as Object).service.addEventListener((RegistrationEventClass as Object).REGISTERING, registeringHandler); - (PushNotificationsClass as Object).service.addEventListener((RegistrationEventClass as Object).REGISTER_SUCCESS, registerSuccessHandler); - (PushNotificationsClass as Object).service.addEventListener((RegistrationEventClass as Object).CHANGED, registrationChangedHandler); - (PushNotificationsClass as Object).service.addEventListener((RegistrationEventClass as Object).REGISTER_FAILED, registerFailedHandler); - (PushNotificationsClass as Object).service.addEventListener((RegistrationEventClass as Object).ERROR,errorHandler); - (PushNotificationsClass as Object).service.addEventListener((AuthorisationEventClass as Object).CHANGED,authorisationChangedHandler); - (PushNotificationsClass as Object).service.addEventListener( (PushNotificationEventClass as Object).NOTIFICATION, notificationHandler ); - (PushNotificationsClass as Object).service.addEventListener( (PushNotificationEventClass as Object).NOTIFICATION_SELECTED, notificationHandler ); - (PushNotificationsClass as Object).service.addEventListener( (PushNotificationEventClass as Object).ACTION, actionHandler ); - (PushNotificationsClass as Object).service.addEventListener( (PushNotificationGroupEventClass as Class).GROUP_SELECTED, groupSelectedHandler ); - - (PushNotificationsClass as Object).service.setup(service); - requestAuthorisation(); - function registeringHandler(event:*):void - { - SaffronLogger.log("Registration started"); - } - - function registerSuccessHandler(event:*):void - { - SaffronLogger.log("Registration succeeded with ID: " + event.data); - deviceToken = event.data; - onResult(event.data); - } - - function registrationChangedHandler(event:*):void - { - SaffronLogger.log("Registration ID has changed: " + event.data); - deviceToken = event.data; - onResult(event.data); - } - - function registerFailedHandler(event:*):void - { - SaffronLogger.log("Registration failed"); - // onResult("Registration failed"); - } - - function errorHandler(event:*):void - { - SaffronLogger.log("Registration error: " + event.data); - // onResult("Registration error"); - } - - } - else - { - SaffronLogger.log("fcm notification is not support"); - // onResult("FCM Not Support"); - } - } - else - { - SaffronLogger.log("notification is not support"); - // onResult("windows Debug"); - } - } - catch (e:Error) - { - SaffronLogger.log("ERROR:" + e.message); - // onResult("error occured"); - } - } + private static var NotifReceived:Function; + public function DistriqtPushNotification() { - private static function notificationHandler( event:* ):void - { - SaffronLogger.log( "Notification: ["+event.type+"] state="+event.applicationState+" startup="+event.startup ); - SaffronLogger.log( event.payload );//{"google.delivered_priority":"high","TypeId":"2","google.ttl":2419200,"google.original_priority":"high","Id":"2096"} - SaffronLogger.log(">>Complete data : "+JSON.stringify(event)); - if(NotifReceived!=null) - { - if(NotifReceived.length>0) - { - NotifReceived(event.payload); - } - else - { - NotifReceived(); - } - } - } + } - private static function actionHandler( event:* ):void - { - SaffronLogger.log( "Action: ["+event.type+"] identifier="+event.identifier+" state="+event.applicationState+" startup="+event.startup ); - SaffronLogger.log( event.payload ); - SaffronLogger.log(">>Complete data : "+JSON.stringify(event)); - } + public static function loadClasses():void { + if (PushNotificationsClass == null) { + try { - private static function groupSelectedHandler( event:* ):void - { - SaffronLogger.log( "Group Selected: ["+event.type+"] groupKey="+event.groupKey+" state="+event.applicationState+" startup="+event.startup ); - for each (var payload:String in event.payloads) - { - SaffronLogger.log( "PAYLOAD: "+ payload ); - } - SaffronLogger.log(">>Complete data : "+JSON.stringify(event)); - } - - private static function authorisationChangedHandler(e:*):void - { - requestAuthorisation(); - } - - private static function requestAuthorisation(e:* = null):void - { - switch ((PushNotificationsClass as Object).service.authorisationStatus()) - { - case (AuthorisationStatusClass as Object).AUTHORISED: - // This device has been authorised. - // You can register this device and expect: - // - registration success/failed event, and; - // - notifications to be displayed - (PushNotificationsClass as Object).service.register(); - break; - - case (AuthorisationStatusClass as Object).NOT_DETERMINED: - // You are yet to ask for authorisation to display notifications - // At this point you should consider your strategy to get your user to authorise - // notifications by explaining what the application will provide - (PushNotificationsClass as Object).service.requestAuthorisation(); - break; - - case (AuthorisationStatusClass as Object).DENIED: - // The user has disabled notifications - // Advise your user of the lack of notifications as you see fit - - // For example: You can redirect to the settings page on iOS - if ((PushNotificationsClass as Object).service.canOpenDeviceSettings) - { - //PushNotifications.service.openDeviceSettings(); - } - break; - } - } - - } + CoreClass = getDefinitionByName("com.distriqt.extension.core.Core") as Class; + AuthorisationStatusClass = getDefinitionByName("com.distriqt.extension.pushnotifications.AuthorisationStatus") as Class; + PushNotificationsClass = getDefinitionByName("com.distriqt.extension.pushnotifications.PushNotifications") as Class; + ServiceClass = getDefinitionByName("com.distriqt.extension.pushnotifications.Service") as Class; + ActionBuilderClass = getDefinitionByName("com.distriqt.extension.pushnotifications.builders.ActionBuilder") as Class; + CategoryBuilderClass = getDefinitionByName("com.distriqt.extension.pushnotifications.builders.CategoryBuilder") as Class; + ChannelBuilderClass = getDefinitionByName("com.distriqt.extension.pushnotifications.builders.ChannelBuilder") as Class; + AuthorisationEventClass = getDefinitionByName("com.distriqt.extension.pushnotifications.events.AuthorisationEvent") as Class; + RegistrationEventClass = getDefinitionByName("com.distriqt.extension.pushnotifications.events.RegistrationEvent") as Class; + PushNotificationEventClass = getDefinitionByName("com.distriqt.extension.pushnotifications.events.PushNotificationEvent") as Class; + PushNotificationGroupEventClass = getDefinitionByName("com.distriqt.extension.pushnotifications.events.PushNotificationGroupEvent") as Class; + SaffronLogger.log("RegistrationEventClass : " + RegistrationEventClass); + } catch (e) { + SaffronLogger.log('Add \n\n\tcom.distriqt.PushNotification\n\tcom.distriqt.Core\n\n to your project xmls'); // and below permitions to the tag : \n\n\n\n\t\n\n\n\n\t\n\n'; + } + } + } -} \ No newline at end of file + public static function isSupport():Boolean { + loadClasses(); + if (PushNotificationsClass == null || PushNotificationsClass.isSupported == false) + return false + else + return true; + } + + /** + * You can receive server data on onNotifReceived function as a String + * @param onResult + * @param onNotifReceived + */ + public static function setup(onResult:Function = null, onNotifReceived:Function = null):void { + NotifReceived = onNotifReceived; + var PushNotifications:Object; + loadClasses(); + if (onResult == null) { + onResult = function(text:String):void { + //show registration ID : + SaffronLogger.log(text); + } + } + if (PushNotificationsClass == null) { + SaffronLogger.log("push notification is null"); + deviceToken = "windowsDebug"; + onResult(deviceToken); + return; + } + try { + (CoreClass as Object).init(); + if (PushNotificationsClass.isSupported) { + SaffronLogger.log("Push Notification supported") + if ((PushNotificationsClass as Object).service.isServiceSupported((ServiceClass as Object).FCM)) { + var service:* = new ServiceClass((ServiceClass as Object).FCM, ""); + service.sandboxMode = true; // false it in production mode!!! + service.enableNotificationsWhenActive = true; + service.setNotificationsWhenActive(true); + service.categories.push(new CategoryBuilderClass().setIdentifier("MESSAGE_CATEGORY").addAction(new ActionBuilderClass().setTitle("OK").setWillLaunchApplication(true).setIdentifier("OPEN_APP_BTN").build()).addAction(new ActionBuilderClass().setTitle("Cancel").setDestructive(true).setShouldCancelOnAction(true).setIdentifier("CANCEL_APP_BTN").build()).build()); + service.channels.push(new ChannelBuilderClass().setId("app_channel").setName("App Channel").build()); + (PushNotificationsClass as Object).service.addEventListener((RegistrationEventClass as Object).REGISTERING, registeringHandler); + (PushNotificationsClass as Object).service.addEventListener((RegistrationEventClass as Object).REGISTER_SUCCESS, registerSuccessHandler); + (PushNotificationsClass as Object).service.addEventListener((RegistrationEventClass as Object).CHANGED, registrationChangedHandler); + (PushNotificationsClass as Object).service.addEventListener((RegistrationEventClass as Object).REGISTER_FAILED, registerFailedHandler); + (PushNotificationsClass as Object).service.addEventListener((RegistrationEventClass as Object).ERROR, errorHandler); + (PushNotificationsClass as Object).service.addEventListener((AuthorisationEventClass as Object).CHANGED, authorisationChangedHandler); + + (PushNotificationsClass as Object).service.addEventListener((PushNotificationEventClass as Object).NOTIFICATION, notificationHandler); + (PushNotificationsClass as Object).service.addEventListener((PushNotificationEventClass as Object).NOTIFICATION_SELECTED, notificationHandler); + (PushNotificationsClass as Object).service.addEventListener((PushNotificationEventClass as Object).ACTION, actionHandler); + (PushNotificationsClass as Object).service.addEventListener((PushNotificationGroupEventClass as Class).GROUP_SELECTED, groupSelectedHandler); + + (PushNotificationsClass as Object).service.setup(service); + requestAuthorisation(); + function registeringHandler(event:*):void { + SaffronLogger.log("Registration started"); + } + + function registerSuccessHandler(event:*):void { + SaffronLogger.log("Registration succeeded with ID: " + event.data); + deviceToken = event.data; + onResult(event.data); + } + + function registrationChangedHandler(event:*):void { + SaffronLogger.log("Registration ID has changed: " + event.data); + deviceToken = event.data; + onResult(event.data); + } + + function registerFailedHandler(event:*):void { + SaffronLogger.log("Registration failed"); + // onResult("Registration failed"); + } + + function errorHandler(event:*):void { + SaffronLogger.log("Registration error: " + event.data); + // onResult("Registration error"); + } + + } else { + SaffronLogger.log("fcm notification is not support"); + // onResult("FCM Not Support"); + } + } else { + SaffronLogger.log("notification is not support"); + // onResult("windows Debug"); + } + } catch (e:Error) { + SaffronLogger.log("ERROR:" + e.message); + // onResult("error occured"); + } + } + + + private static function notificationHandler(event:*):void { + SaffronLogger.log("Notification: [" + event.type + "] state=" + event.applicationState + " startup=" + event.startup); + SaffronLogger.log(event.payload); //{"google.delivered_priority":"high","TypeId":"2","google.ttl":2419200,"google.original_priority":"high","Id":"2096"} + SaffronLogger.log(">>Complete data : " + JSON.stringify(event)); + if (NotifReceived != null) { + if (NotifReceived.length > 0) { + NotifReceived(event.payload); + } else { + NotifReceived(); + } + } + } + + private static function actionHandler(event:*):void { + SaffronLogger.log("Action: [" + event.type + "] identifier=" + event.identifier + " state=" + event.applicationState + " startup=" + event.startup); + SaffronLogger.log(event.payload); + SaffronLogger.log(">>Complete data : " + JSON.stringify(event)); + } + + private static function groupSelectedHandler(event:*):void { + SaffronLogger.log("Group Selected: [" + event.type + "] groupKey=" + event.groupKey + " state=" + event.applicationState + " startup=" + event.startup); + for each (var payload:String in event.payloads) { + SaffronLogger.log("PAYLOAD: " + payload); + } + SaffronLogger.log(">>Complete data : " + JSON.stringify(event)); + } + + private static function authorisationChangedHandler(e:*):void { + requestAuthorisation(); + } + + private static function requestAuthorisation(e:* = null):void { + switch ((PushNotificationsClass as Object).service.authorisationStatus()) { + case (AuthorisationStatusClass as Object).AUTHORISED: + // This device has been authorised. + // You can register this device and expect: + // - registration success/failed event, and; + // - notifications to be displayed + (PushNotificationsClass as Object).service.register(); + break; + + case (AuthorisationStatusClass as Object).NOT_DETERMINED: + // You are yet to ask for authorisation to display notifications + // At this point you should consider your strategy to get your user to authorise + // notifications by explaining what the application will provide + (PushNotificationsClass as Object).service.requestAuthorisation(); + break; + + case (AuthorisationStatusClass as Object).DENIED: + // The user has disabled notifications + // Advise your user of the lack of notifications as you see fit + + // For example: You can redirect to the settings page on iOS + if ((PushNotificationsClass as Object).service.canOpenDeviceSettings) { + //PushNotifications.service.openDeviceSettings(); + } + break; + } + } + + } + +} From 7d3285d2e001ca6bab7a5367daee30c942351073 Mon Sep 17 00:00:00 2001 From: Younes Mashayekhi Date: Mon, 21 Dec 2020 17:57:40 +0330 Subject: [PATCH 19/64] Update DistriqtPushNotification.as --- .../DistriqtPushNotification.as | 72 ++++++++++++++----- 1 file changed, 53 insertions(+), 19 deletions(-) diff --git a/nativeClasses/pushNotification/DistriqtPushNotification.as b/nativeClasses/pushNotification/DistriqtPushNotification.as index fee95eb..b4e1292 100644 --- a/nativeClasses/pushNotification/DistriqtPushNotification.as +++ b/nativeClasses/pushNotification/DistriqtPushNotification.as @@ -19,31 +19,32 @@ */ public class DistriqtPushNotification { public static var deviceToken:String; - public static var CoreClass:Class; - public static var AuthorisationStatusClass:Class; - public static var PushNotificationsClass:Class; - public static var ServiceClass:Class; - public static var ActionBuilderClass:Class; - public static var CategoryBuilderClass:Class; - public static var ChannelBuilderClass:Class; - public static var AuthorisationEventClass:Class; - public static var RegistrationEventClass:Class; + private static var CoreClass:Class; + private static var AuthorisationStatusClass:Class; + private static var PushNotificationsClass:Class; + private static var ServiceClass:Class; + private static var ActionBuilderClass:Class; + private static var CategoryBuilderClass:Class; + private static var ChannelBuilderClass:Class; + private static var AuthorisationEventClass:Class; + private static var RegistrationEventClass:Class; + private static var InAppMessagingEventClass:Class; /**com.distriqt.extension.pushnotifications.events.PushNotificationEvent */ - public static var PushNotificationEventClass:Class; + private static var PushNotificationEventClass:Class; /**com.distriqt.extension.pushnotifications.events.PushNotificationGroupEvent */ - public static var PushNotificationGroupEventClass:Class; + private static var PushNotificationGroupEventClass:Class; private static var NotifReceived:Function; + private static var InAppMsgRecevied:Function; public function DistriqtPushNotification() { } - public static function loadClasses():void { + private static function loadClasses():void { if (PushNotificationsClass == null) { try { - CoreClass = getDefinitionByName("com.distriqt.extension.core.Core") as Class; AuthorisationStatusClass = getDefinitionByName("com.distriqt.extension.pushnotifications.AuthorisationStatus") as Class; PushNotificationsClass = getDefinitionByName("com.distriqt.extension.pushnotifications.PushNotifications") as Class; @@ -55,6 +56,7 @@ RegistrationEventClass = getDefinitionByName("com.distriqt.extension.pushnotifications.events.RegistrationEvent") as Class; PushNotificationEventClass = getDefinitionByName("com.distriqt.extension.pushnotifications.events.PushNotificationEvent") as Class; PushNotificationGroupEventClass = getDefinitionByName("com.distriqt.extension.pushnotifications.events.PushNotificationGroupEvent") as Class; + InAppMessagingEventClass = getDefinitionByName("com.distriqt.extension.pushnotifications.events.InAppMessagingEvent") as Class; SaffronLogger.log("RegistrationEventClass : " + RegistrationEventClass); } catch (e) { SaffronLogger.log('Add \n\n\tcom.distriqt.PushNotification\n\tcom.distriqt.Core\n\n to your project xmls'); // and below permitions to the tag : \n\n\n\n\t\n\n\n\n\t\n\n'; @@ -71,12 +73,14 @@ } /** - * You can receive server data on onNotifReceived function as a String + * You can receive server data on onNotifReceived & onInAppMsgRecevied function as a String * @param onResult * @param onNotifReceived + * @param onInAppMsgRecevied */ - public static function setup(onResult:Function = null, onNotifReceived:Function = null):void { + public static function setup(onResult:Function = null, onNotifReceived:Function = null, onInAppMsgRecevied:Function = null):void { NotifReceived = onNotifReceived; + InAppMsgRecevied = onInAppMsgRecevied; var PushNotifications:Object; loadClasses(); if (onResult == null) { @@ -98,7 +102,6 @@ if ((PushNotificationsClass as Object).service.isServiceSupported((ServiceClass as Object).FCM)) { var service:* = new ServiceClass((ServiceClass as Object).FCM, ""); service.sandboxMode = true; // false it in production mode!!! - service.enableNotificationsWhenActive = true; service.setNotificationsWhenActive(true); service.categories.push(new CategoryBuilderClass().setIdentifier("MESSAGE_CATEGORY").addAction(new ActionBuilderClass().setTitle("OK").setWillLaunchApplication(true).setIdentifier("OPEN_APP_BTN").build()).addAction(new ActionBuilderClass().setTitle("Cancel").setDestructive(true).setShouldCancelOnAction(true).setIdentifier("CANCEL_APP_BTN").build()).build()); service.channels.push(new ChannelBuilderClass().setId("app_channel").setName("App Channel").build()); @@ -108,12 +111,10 @@ (PushNotificationsClass as Object).service.addEventListener((RegistrationEventClass as Object).REGISTER_FAILED, registerFailedHandler); (PushNotificationsClass as Object).service.addEventListener((RegistrationEventClass as Object).ERROR, errorHandler); (PushNotificationsClass as Object).service.addEventListener((AuthorisationEventClass as Object).CHANGED, authorisationChangedHandler); - (PushNotificationsClass as Object).service.addEventListener((PushNotificationEventClass as Object).NOTIFICATION, notificationHandler); (PushNotificationsClass as Object).service.addEventListener((PushNotificationEventClass as Object).NOTIFICATION_SELECTED, notificationHandler); (PushNotificationsClass as Object).service.addEventListener((PushNotificationEventClass as Object).ACTION, actionHandler); (PushNotificationsClass as Object).service.addEventListener((PushNotificationGroupEventClass as Class).GROUP_SELECTED, groupSelectedHandler); - (PushNotificationsClass as Object).service.setup(service); requestAuthorisation(); function registeringHandler(event:*):void { @@ -162,7 +163,7 @@ SaffronLogger.log(event.payload); //{"google.delivered_priority":"high","TypeId":"2","google.ttl":2419200,"google.original_priority":"high","Id":"2096"} SaffronLogger.log(">>Complete data : " + JSON.stringify(event)); if (NotifReceived != null) { - if (NotifReceived.length > 0) { + if (JSON.stringify(event.data).length > 0) { NotifReceived(event.payload); } else { NotifReceived(); @@ -184,6 +185,39 @@ SaffronLogger.log(">>Complete data : " + JSON.stringify(event)); } + public static function setupInAppMessaging():void { + // call this function after a few second after setup pushnotification + if (PushNotificationsClass == null) { + //windowsDebug; + return; + } + if ((PushNotificationsClass as Object).service.inAppMessaging.isSupported) { + (PushNotificationsClass as Object).service.inAppMessaging.addEventListener((InAppMessagingEventClass as Object).SELECTED, inappmessaging_selectedHandler); + Alert.show("InAppMessaging SUPPORTED") + } else { + Alert.show("InAppMessaging NOT SUPPORTED") + } + } + + public static function setTriggerForInAppMessaging(key:String, value:String = ""):void { + //at first,you must call setupInAppMessaging method + if (PushNotificationsClass == null) { + //windowsDebug; + return; + } + (PushNotificationsClass as Object).service.inAppMessaging.addTrigger(key, value); + } + + private static function inappmessaging_selectedHandler(event:*):void { + if (InAppMsgRecevied != null) { + if (JSON.stringify(event.data).length > 0) { + InAppMsgRecevied(JSON.stringify(event.data)); + } else { + InAppMsgRecevied(); + } + } + } + private static function authorisationChangedHandler(e:*):void { requestAuthorisation(); } From db65b3ba267c4f6c099e42deba24dd872189786b Mon Sep 17 00:00:00 2001 From: Younes Mashayekhi Date: Mon, 21 Dec 2020 17:59:52 +0330 Subject: [PATCH 20/64] Update DistriqtPushNotification.as --- nativeClasses/pushNotification/DistriqtPushNotification.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativeClasses/pushNotification/DistriqtPushNotification.as b/nativeClasses/pushNotification/DistriqtPushNotification.as index b4e1292..76eba7f 100644 --- a/nativeClasses/pushNotification/DistriqtPushNotification.as +++ b/nativeClasses/pushNotification/DistriqtPushNotification.as @@ -163,7 +163,7 @@ SaffronLogger.log(event.payload); //{"google.delivered_priority":"high","TypeId":"2","google.ttl":2419200,"google.original_priority":"high","Id":"2096"} SaffronLogger.log(">>Complete data : " + JSON.stringify(event)); if (NotifReceived != null) { - if (JSON.stringify(event.data).length > 0) { + if (JSON.stringify(event.payload).length > 0) { NotifReceived(event.payload); } else { NotifReceived(); From e6de96a40ec4bd1af7439c7fb4e816375d843288 Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Tue, 29 Dec 2020 10:31:13 +0330 Subject: [PATCH 21/64] Update SliderManager.as --- sliderMenu/SliderManager.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sliderMenu/SliderManager.as b/sliderMenu/SliderManager.as index c29f1eb..003514e 100644 --- a/sliderMenu/SliderManager.as +++ b/sliderMenu/SliderManager.as @@ -348,7 +348,7 @@ package sliderMenu /**start the drag*/ private static function checkDrag(e:MouseEvent):void { - if(lock_flag) + if(lock_flag || PopMenu.isOpen) { //menu is lock return ; From a9fcb3de87b9873282dc5ad19040949997dc53bf Mon Sep 17 00:00:00 2001 From: Mohmmad Ebrahim Sepehr Date: Tue, 29 Dec 2020 10:31:16 +0330 Subject: [PATCH 22/64] Update CalenderConstants.as --- diagrams/calender/CalenderConstants.as | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/diagrams/calender/CalenderConstants.as b/diagrams/calender/CalenderConstants.as index 1a09b98..0d3e3da 100644 --- a/diagrams/calender/CalenderConstants.as +++ b/diagrams/calender/CalenderConstants.as @@ -32,6 +32,11 @@ package diagrams.calender public static var dayNames:Array = [d0,d1,d2,d3,d4,d5,d6]; + + public static function getDayNameFarsi(date:Date):String + { + return dayNames[(date.day+1)%7]; + } public static var dayNames2:Vector. = new Vector.(); dayNames2.push(dd0,dd1,dd2,dd3,dd4,dd5,dd6); From 5075fffa2a7543a7fca42967f8ba9e4c99e477a7 Mon Sep 17 00:00:00 2001 From: MESepehr Date: Mon, 8 Mar 2021 11:00:55 +0330 Subject: [PATCH 23/64] Update WebServiceCaller.as --- webService/webCallers/WebServiceCaller.as | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/webService/webCallers/WebServiceCaller.as b/webService/webCallers/WebServiceCaller.as index cfb4f49..c0fcc12 100644 --- a/webService/webCallers/WebServiceCaller.as +++ b/webService/webCallers/WebServiceCaller.as @@ -63,6 +63,7 @@ private var func_onDataRetrived:Function, func_onConnectionError:Function, + func_onConnected:Function, func_onError:Function; private var reloadIfNotConnected:Boolean = false ; @@ -97,10 +98,9 @@ return this ; } - public function onConnected2(onError:Function):WebServiceCaller + public function onConnected2(onConnectedFunc:Function):WebServiceCaller { - func_onConnectionError = onError; - func_onError = onError; + func_onConnected = onConnectedFunc; return this ; } @@ -225,7 +225,7 @@ myWebService.CanselThisToken(myToken); } - private function onConnected() + private function onConnected():void { SaffronLogger.log("connected"); //TODO: implement function @@ -267,6 +267,7 @@ func_onDataRetrived(); }*/ this.dispatchEvent(new Event(Event.CONNECT)); + if(func_onConnected!=null)func_onConnected(); } } From 06f986a8642d9b10547282bfc9ce6427716e405c Mon Sep 17 00:00:00 2001 From: MESepehr Date: Mon, 15 Mar 2021 15:54:18 +0330 Subject: [PATCH 24/64] Control if media is exists --- darkBox/DarkBox.as | 38 ++++++++++++++++++++++++++++++++++++++ darkBox/ImageFile.as | 5 +++++ 2 files changed, 43 insertions(+) diff --git a/darkBox/DarkBox.as b/darkBox/DarkBox.as index 3ee41c4..342ca7c 100644 --- a/darkBox/DarkBox.as +++ b/darkBox/DarkBox.as @@ -30,6 +30,9 @@ import stageManager.StageManagerEvent; import videoShow.StageVideo; + import flash.net.URLLoader; + import flash.events.HTTPStatusEvent; + import flash.events.IOErrorEvent; public class DarkBox extends MovieClip { @@ -68,6 +71,7 @@ private var closeFunction:Function; private var imageSize:Rectangle; + private var videoLoaderTest:URLLoader; /**Get the current file*/ public static function get currentMedia():ImageFile @@ -607,6 +611,26 @@ showReadyImage(event.target as ImageFile); } + + + private function httpStat(e:HTTPStatusEvent):void + { + if(e.status==404) + { + Hints.show('ویدئو مورد نظر از سرور حذف شده است.'); + videoLoaderTest.close(); + videoLoaderTest = undefined ; + if(images.length<=1) + hide(); + } + } + + private function notConnection(e:IOErrorEvent):void + { + Hints.noInternet(); + videoLoaderTest.close(); + videoLoaderTest = undefined ; + } private function showReadyImage(imageItem:ImageFile):void { @@ -629,6 +653,20 @@ case ImageFile.TYPE_VIDEO: downloadMC.visible = false; showQuailyBtn(imageItem.qualityCount()); + + + + + if(videoLoaderTest) + { + videoLoaderTest.close(); + videoLoaderTest = undefined ; + } + videoLoaderTest = new URLLoader(); + videoLoaderTest.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS,httpStat); + videoLoaderTest.addEventListener(IOErrorEvent.IO_ERROR,notConnection); + videoLoaderTest.load(new URLRequest(imageItem.FirstFile())); + if (DevicePrefrence.isItPC || !DistriqtMediaPlayer.isSupports) { if (DevicePrefrence.isIOS() || imageItem.target.toLocaleLowerCase().indexOf('.flv') == -1) diff --git a/darkBox/ImageFile.as b/darkBox/ImageFile.as index a644bbf..b9b743c 100644 --- a/darkBox/ImageFile.as +++ b/darkBox/ImageFile.as @@ -115,6 +115,11 @@ package darkBox return target.split('|').length } + public function FirstFile():String + { + return target.split('|')[0]; + } + private function startDownload():void { if(onlineTarget=='') From 229b8385542ac78f5a7102931dd59b8a8fe4c1b1 Mon Sep 17 00:00:00 2001 From: MESepehr Date: Mon, 15 Mar 2021 15:55:17 +0330 Subject: [PATCH 25/64] File permission control on URLSaver --- netManager/urlSaver/URLSaver.as | 38 +++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/netManager/urlSaver/URLSaver.as b/netManager/urlSaver/URLSaver.as index 00a163a..fc74a58 100644 --- a/netManager/urlSaver/URLSaver.as +++ b/netManager/urlSaver/URLSaver.as @@ -358,7 +358,7 @@ package netManager.urlSaver private function saveLoadedBytes():void { - + trace("Download file done"); var oflineFolder:File; if(mySpecialFolder!=null) { @@ -445,21 +445,27 @@ package netManager.urlSaver fileSaver.close(); fileSaver = null ; } - fileSaver = new FileStream(); - fileSaver.addEventListener(Event.CLOSE,fileIsSaved); - fileSaver.addEventListener(IOErrorEvent.IO_ERROR,fileSaverError); - fileSaver.openAsync(oflineFile,FileMode.WRITE); - fileSaver.writeBytes(myLoadedBytes); - fileSaver.close(); - //SaffronLogger.log("Save the imafe on device...................................... : "+oflineFile.url+' > '+myLoadedBytes.bytesAvailable); - - //SavedDatas.save(onlineURL,offlineURL); - //SaffronLogger.log('offile file saved on : '+onlineURL); - storage.data[onlineURL] = offlineURL ; - datestorage.data[onlineURL] = new Date().time ; - //SaffronLogger.log("datestorage.data[onlineURL] : " +datestorage.data[onlineURL]); - datestorage.flush(); - storage.flush(); + + FileManager.controlFilePermission(startSaveItem,true); + + function startSaveItem():void + { + fileSaver = new FileStream(); + fileSaver.addEventListener(Event.CLOSE,fileIsSaved); + fileSaver.addEventListener(IOErrorEvent.IO_ERROR,fileSaverError); + fileSaver.openAsync(oflineFile,FileMode.WRITE); + fileSaver.writeBytes(myLoadedBytes); + fileSaver.close(); + SaffronLogger.log("Save the imafe on device...................................... : "+oflineFile.url+' > '+myLoadedBytes.bytesAvailable); + + //SavedDatas.save(onlineURL,offlineURL); + //SaffronLogger.log('offile file saved on : '+onlineURL); + storage.data[onlineURL] = offlineURL ; + datestorage.data[onlineURL] = new Date().time ; + //SaffronLogger.log("datestorage.data[onlineURL] : " +datestorage.data[onlineURL]); + datestorage.flush(); + storage.flush(); + } } protected function fileSaverError(event:IOErrorEvent):void From f7c58d3d8eeefde618a37df22dd894a2c23b0171 Mon Sep 17 00:00:00 2001 From: MESepehr Date: Mon, 15 Mar 2021 15:55:28 +0330 Subject: [PATCH 26/64] MediaPlayer debugged --- nativeClasses/player/DistriqtMediaPlayer.as | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nativeClasses/player/DistriqtMediaPlayer.as b/nativeClasses/player/DistriqtMediaPlayer.as index 52c7ebb..95e89c0 100644 --- a/nativeClasses/player/DistriqtMediaPlayer.as +++ b/nativeClasses/player/DistriqtMediaPlayer.as @@ -351,6 +351,8 @@ } videoURL = videoQualities[index]; + if(nc) + nc.removeEventListener(NetStatusEvent.NET_STATUS, nc_status); nc = new NetConnection(); nc.addEventListener(NetStatusEvent.NET_STATUS, nc_status); nc.connect(null); @@ -378,7 +380,7 @@ }); if (playFirstVideo == true) // play for first time { - player.load(videoURL); + if(player)player.load(videoURL); playFirstVideo = false; } else From 8638fe0ad13b7e1a414590279c7eadca350931f5 Mon Sep 17 00:00:00 2001 From: MESepehr Date: Wed, 17 Mar 2021 17:15:23 +0330 Subject: [PATCH 27/64] I hated this feature all these time... --- popForm/PopField.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/popForm/PopField.as b/popForm/PopField.as index 9604a94..5b53e39 100644 --- a/popForm/PopField.as +++ b/popForm/PopField.as @@ -395,7 +395,7 @@ myTXT.multiline = true ; myTXT.wordWrap = true ; } - backMC.visible = false ; + //backMC.visible = false ; if(textContainerMC==null) { From 23a57404484b20fbeddbfdd495f9cb1352fee31b Mon Sep 17 00:00:00 2001 From: MESepehr <4157133+MESepehr@users.noreply.github.com> Date: Sun, 4 Apr 2021 12:43:42 +0430 Subject: [PATCH 28/64] Update FrameGenerator.as --- dynamicFrame/FrameGenerator.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dynamicFrame/FrameGenerator.as b/dynamicFrame/FrameGenerator.as index f3adbc9..05eff10 100644 --- a/dynamicFrame/FrameGenerator.as +++ b/dynamicFrame/FrameGenerator.as @@ -24,7 +24,7 @@ import flash.text.TextField; color = defaultColor ; var margin:uint = 1 ; var extarTopMargin:uint = 0 ; - var roundLevel:uint = 5 ; + var roundLevel:uint = 0 ; var frame:Sprite = new Sprite(); stage.addChild(frame); frame.graphics.beginFill(color); From 1dd748a174b7e27c25cd3a3675a0bebeddcb3d74 Mon Sep 17 00:00:00 2001 From: MESepehr <4157133+MESepehr@users.noreply.github.com> Date: Sun, 4 Apr 2021 12:43:50 +0430 Subject: [PATCH 29/64] Update DarkBox.as --- darkBox/DarkBox.as | 1 + 1 file changed, 1 insertion(+) diff --git a/darkBox/DarkBox.as b/darkBox/DarkBox.as index 342ca7c..305083d 100644 --- a/darkBox/DarkBox.as +++ b/darkBox/DarkBox.as @@ -33,6 +33,7 @@ import flash.net.URLLoader; import flash.events.HTTPStatusEvent; import flash.events.IOErrorEvent; + import popForm.Hints; public class DarkBox extends MovieClip { From 10355a2fed3af4b61256e2c8dffb01aa4e081694 Mon Sep 17 00:00:00 2001 From: MESepehr <4157133+MESepehr@users.noreply.github.com> Date: Sun, 4 Apr 2021 12:44:29 +0430 Subject: [PATCH 30/64] Prevent unnecessary file access prompt --- wrokersJob/WorkerFunctions.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrokersJob/WorkerFunctions.as b/wrokersJob/WorkerFunctions.as index c694290..08cb676 100644 --- a/wrokersJob/WorkerFunctions.as +++ b/wrokersJob/WorkerFunctions.as @@ -93,7 +93,7 @@ else SaffronLogger.log(moreHints); } - var workerBytes:ByteArray = FileManager.loadFile(workerTarget); + var workerBytes:ByteArray = FileManager.loadFile(workerTarget,false,null,false); SaffronLogger.log("workerTarget.exists : "+workerTarget.exists); SaffronLogger.log("Capabilities.isDebugger : "+Capabilities.isDebugger); From 07a196dfd5de60108fae1c9aeb544d549c79b067 Mon Sep 17 00:00:00 2001 From: MESepehr <4157133+MESepehr@users.noreply.github.com> Date: Tue, 6 Apr 2021 16:34:34 +0430 Subject: [PATCH 31/64] Do not get unnecessary file access permission --- netManager/urlSaver/URLSaver.as | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/netManager/urlSaver/URLSaver.as b/netManager/urlSaver/URLSaver.as index fc74a58..6c58945 100644 --- a/netManager/urlSaver/URLSaver.as +++ b/netManager/urlSaver/URLSaver.as @@ -446,7 +446,14 @@ package netManager.urlSaver fileSaver = null ; } - FileManager.controlFilePermission(startSaveItem,true); + if(oflineFile.nativePath.indexOf(File.applicationStorageDirectory.nativePath)!=-1) + { + startSaveItem(); + } + else + { + FileManager.controlFilePermission(startSaveItem,true); + } function startSaveItem():void { From d9082b88db6b5310267fa9dd217843a277ac9a14 Mon Sep 17 00:00:00 2001 From: MESepehr <4157133+MESepehr@users.noreply.github.com> Date: Mon, 26 Apr 2021 14:57:12 +0430 Subject: [PATCH 32/64] Update DistriqtPushNotification.as --- .../pushNotification/DistriqtPushNotification.as | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nativeClasses/pushNotification/DistriqtPushNotification.as b/nativeClasses/pushNotification/DistriqtPushNotification.as index 76eba7f..5e06591 100644 --- a/nativeClasses/pushNotification/DistriqtPushNotification.as +++ b/nativeClasses/pushNotification/DistriqtPushNotification.as @@ -97,9 +97,11 @@ } try { (CoreClass as Object).init(); + trace("CoreClass init") if (PushNotificationsClass.isSupported) { SaffronLogger.log("Push Notification supported") if ((PushNotificationsClass as Object).service.isServiceSupported((ServiceClass as Object).FCM)) { + SaffronLogger.log("FCM supported") var service:* = new ServiceClass((ServiceClass as Object).FCM, ""); service.sandboxMode = true; // false it in production mode!!! service.setNotificationsWhenActive(true); @@ -193,9 +195,9 @@ } if ((PushNotificationsClass as Object).service.inAppMessaging.isSupported) { (PushNotificationsClass as Object).service.inAppMessaging.addEventListener((InAppMessagingEventClass as Object).SELECTED, inappmessaging_selectedHandler); - Alert.show("InAppMessaging SUPPORTED") + SaffronLogger.log("InAppMessaging SUPPORTED") } else { - Alert.show("InAppMessaging NOT SUPPORTED") + SaffronLogger.log("InAppMessaging NOT SUPPORTED") } } @@ -217,7 +219,7 @@ } } } - + private static function authorisationChangedHandler(e:*):void { requestAuthorisation(); } From 6b19a44353e3fd5d89961ad1d2293f928fd72d39 Mon Sep 17 00:00:00 2001 From: mehdi karimpoor Date: Tue, 27 Apr 2021 11:21:24 +0430 Subject: [PATCH 33/64] onItemSelected --- contents/displayPages/DynamicLinks.as | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/contents/displayPages/DynamicLinks.as b/contents/displayPages/DynamicLinks.as index 7afa1cf..cd646ed 100644 --- a/contents/displayPages/DynamicLinks.as +++ b/contents/displayPages/DynamicLinks.as @@ -36,6 +36,7 @@ package contents.displayPages import flash.utils.getDefinitionByName; import flash.utils.getQualifiedClassName; import contents.displayElements.SaffronPreLoader; + import appManager.event.AppEventContent; /**Reload required*/ [Event(name="RELOAD_REQUIRED", type="contents.displayPages.DynamicLinksEvent")] @@ -66,12 +67,34 @@ package contents.displayPages private const linkSensorDebug:Number = 0.0 ; protected var myPageData:PageData ; + + private var _itemSelected:Function ; /**This is the DynamicLinks current page data*/ public function get pageData():PageData { return myPageData } + + /**You will receive linkData on this function */ + public function onItemSelected(itemSelected:Function):void + { + _itemSelected = itemSelected ; + this.removeEventListener(AppEventContent.PAGE_CHANGES,catchPageChange); + this.addEventListener(AppEventContent.PAGE_CHANGES,catchPageChange); + } + + private function catchPageChange(e:AppEventContent):void + { + if(_itemSelected!=null) + { + e.stopImmediatePropagation(); + if(_itemSelected.length==0) + _itemSelected(); + else + _itemSelected(e.linkData); + } + } protected var sampleLink:LinkItem, linkClass:Class; From c6b1174d9e929024ffa10df00f1b22d1ceeda6f1 Mon Sep 17 00:00:00 2001 From: MESepehr <4157133+MESepehr@users.noreply.github.com> Date: Tue, 27 Apr 2021 17:48:17 +0430 Subject: [PATCH 34/64] Force to update stage position to solve small size openning --- appManager/animatedPages/Intro.as | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/appManager/animatedPages/Intro.as b/appManager/animatedPages/Intro.as index d90f2f5..9873151 100644 --- a/appManager/animatedPages/Intro.as +++ b/appManager/animatedPages/Intro.as @@ -2,6 +2,8 @@ package appManager.animatedPages {//appManager.animatedPages.Intro import flash.display.MovieClip; import flash.events.Event; + import stageManager.StageManager; + import contents.alert.Alert; [Event(name="imFinished", type="flash.events.Event")] public class Intro extends MovieClip @@ -13,12 +15,22 @@ package appManager.animatedPages stop(); this.addFrameScript(this.totalFrames-1,introIsOver); + this.addFrameScript(Math.ceil((this.totalFrames/3)*2),controlStage); } - private function introIsOver() + private function introIsOver():void { this.stop(); this.dispatchEvent(new Event(EVENT_FINISHED)); + controlStage(); + } + + private function controlStage():void + { + if(StageManager.isSatUp()) + { + StageManager.controllStageSizes(null,false,true); + } } } } \ No newline at end of file From 19b8df34ad8a6c43527686c338fb4eeae06d92fe Mon Sep 17 00:00:00 2001 From: mehdi karimpoor Date: Mon, 28 Jun 2021 15:52:14 +0430 Subject: [PATCH 35/64] Force to reload parameter addec to changePageByLink --- appManager/mains/App.as | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appManager/mains/App.as b/appManager/mains/App.as index 1e60411..f7c321b 100644 --- a/appManager/mains/App.as +++ b/appManager/mains/App.as @@ -78,9 +78,9 @@ ME.dispatchEvent(new AppEventContent(link,false,forceToRefreshPage)); } - public static function changePageByLink(pageLink:LinkData):void + public static function changePageByLink(pageLink:LinkData,forceToReload:Boolean=false):void { - ME.dispatchEvent(new AppEventContent(pageLink)); + ME.dispatchEvent(new AppEventContent(pageLink,false,forceToReload)); } //replaced with TitleManager.ME From a97c09730fb07370aaa5f44365693b3fe7511b24 Mon Sep 17 00:00:00 2001 From: mehdi karimpoor Date: Mon, 28 Jun 2021 15:52:42 +0430 Subject: [PATCH 36/64] Update Contents.as --- contents/Contents.as | 3 --- 1 file changed, 3 deletions(-) diff --git a/contents/Contents.as b/contents/Contents.as index a4f7eb6..e77eecf 100644 --- a/contents/Contents.as +++ b/contents/Contents.as @@ -10,10 +10,7 @@ import flash.display.Stage; import flash.events.Event; import flash.filesystem.File; - import flash.filesystem.FileMode; - import flash.filesystem.FileStream; import flash.net.URLLoader; - import flash.utils.getTimer; public class Contents From 25b1aa7069e650f9d9c0af96728f9f177626fb55 Mon Sep 17 00:00:00 2001 From: mehdi karimpoor Date: Mon, 28 Jun 2021 15:52:52 +0430 Subject: [PATCH 37/64] PageLogger!! --- appManager/mains/AppWithContent.as | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/appManager/mains/AppWithContent.as b/appManager/mains/AppWithContent.as index b87abdf..f6407e8 100644 --- a/appManager/mains/AppWithContent.as +++ b/appManager/mains/AppWithContent.as @@ -61,6 +61,7 @@ import flash.display.DisplayObjectContainer; import com.mteamapp.BlackStageDebugger; import nativeClasses.distriqtApplication.DistriqtApplication; + import flash.net.URLLoader; public class AppWithContent extends App { @@ -87,6 +88,8 @@ /**StageMask is using to cover the bottom of the page, when a keboard moves stage to up */ private var stageMask:Sprite ; + + private var pageLoggerRequest:URLRequest,pageLoggerLoader:URLLoader; /**This is the contentManager rectangle size. it will generate from the content w and h on the home xml tag*/ public static function get contentRect():Rectangle @@ -459,6 +462,13 @@ { SaffronLogger.log("History changed"); History.pushHistory((event as AppEventContent).linkData); + + + } + + if(event2!=null) + { + logPageChange(event2.myID); } if((!DevicePrefrence.isItPC) && mouseClickCounter>0) @@ -469,6 +479,24 @@ return duplicatePageController ; } + + /**Save teh page ID to Analytic server */ + private function logPageChange(pageId:String):void + { + if(pageLoggerRequest==null) + { + pageLoggerRequest = new URLRequest(Contents.config.version_controll_url); + pageLoggerRequest.contentType = 'application/json'; + pageLoggerRequest.method = URLRequestMethod.POST ; + } + pageLoggerRequest.data = JSON.stringify({AppId:DevicePrefrence.appID,PageName:pageId,Enter:true}) ; + if(pageLoggerLoader==null) + { + pageLoggerLoader = new URLLoader(); + } + pageLoggerLoader.load(pageLoggerRequest); + + } /**Contents are load now*/ protected function startApp():void From 9e2308033e01aafcc15070e317fd3ae3bd02d0d4 Mon Sep 17 00:00:00 2001 From: mehdi karimpoor Date: Wed, 14 Jul 2021 16:24:55 +0430 Subject: [PATCH 38/64] =?UTF-8?q?=D8=A7=D8=B5=D9=84=D8=A7=D8=AD=D8=A7?= =?UTF-8?q?=D8=AA=20=DA=A9=D8=AF=20=D8=A8=D8=B1=D8=A7=DB=8C=20=D8=A7=D8=B3?= =?UTF-8?q?=D8=AA=D9=81=D8=A7=D8=AF=D9=87=20=D8=AF=D8=B1=20=D8=A7=D9=BE=20?= =?UTF-8?q?=D8=AA=D8=AC=D8=A7=D8=B1=D8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appManager/mains/AppWithContent.as | 2 ++ darkBox/WebOpener.as | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/appManager/mains/AppWithContent.as b/appManager/mains/AppWithContent.as index f6407e8..4bb21c3 100644 --- a/appManager/mains/AppWithContent.as +++ b/appManager/mains/AppWithContent.as @@ -62,6 +62,7 @@ import com.mteamapp.BlackStageDebugger; import nativeClasses.distriqtApplication.DistriqtApplication; import flash.net.URLLoader; + import flash.events.IOErrorEvent; public class AppWithContent extends App { @@ -493,6 +494,7 @@ if(pageLoggerLoader==null) { pageLoggerLoader = new URLLoader(); + pageLoggerLoader.addEventListener(IOErrorEvent.IO_ERROR,function():void{}) } pageLoggerLoader.load(pageLoggerRequest); diff --git a/darkBox/WebOpener.as b/darkBox/WebOpener.as index 6fbcae3..3cf19ab 100644 --- a/darkBox/WebOpener.as +++ b/darkBox/WebOpener.as @@ -11,6 +11,7 @@ import flash.utils.setTimeout; import nativeClasses.pdfReader.DistriqtPDFReader; + import contents.alert.Alert; internal class WebOpener extends DefaultImage { @@ -38,7 +39,7 @@ if(stageVewIsOpened && this.stage!=null) { myStageWeb.dispose(); - myStageWeb = new StageWebView(); + myStageWeb = new StageWebView(true); myStageWeb.viewPort = this.getBounds(stage); } try @@ -151,7 +152,21 @@ stageVewIsOpened = true ; myStageWeb.stage = stage ; //SaffronLogger.log("PDF path : "+pdftarget.nativePath); - myStageWeb.loadURL(onlineShow?target:pdftarget.url); + if(onlineShow) + { + if(target.indexOf('http')!=-1 && target.indexOf(' Date: Sun, 25 Jul 2021 16:59:09 +0430 Subject: [PATCH 39/64] Update AppWithContent.as --- appManager/mains/AppWithContent.as | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appManager/mains/AppWithContent.as b/appManager/mains/AppWithContent.as index 4bb21c3..d89fc7c 100644 --- a/appManager/mains/AppWithContent.as +++ b/appManager/mains/AppWithContent.as @@ -538,9 +538,9 @@ } /**The application is expired*/ - private function stopThisVersion(theHint:String,appURL:String):void + private function stopThisVersion(theHint:String,appURL:String,forceToUpdate:Boolean=true):void { - if(isExpired(theHint,appURL)) + if(isExpired(theHint,appURL,forceToUpdate) && forceToUpdate) { SaffronLogger.log("Switch to the download url instantly"); resetIntro(); @@ -557,7 +557,7 @@ /**Returns true if there is no listener on this function, so the application have to redirect to the server*/ - protected function isExpired(hint:String,link:String):Boolean + protected function isExpired(hint:String,link:String,forceToUpdate:Boolean=true):Boolean { Alert.show(hint.replace("ID","ID ("+DevicePrefrence.appID+")")); return true ; From d1f4a5369c75ccfa84b0c3fcf7c18735ab041eeb Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sun, 25 Jul 2021 17:24:46 +0430 Subject: [PATCH 40/64] Prevent saffron log when user call the direct function --- appManager/mains/AppWithContent.as | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/appManager/mains/AppWithContent.as b/appManager/mains/AppWithContent.as index d89fc7c..b78aef3 100644 --- a/appManager/mains/AppWithContent.as +++ b/appManager/mains/AppWithContent.as @@ -507,15 +507,25 @@ playIntro(); if(!(skipAnimations || Contents.config.skipAnimations)) { - var versionContrllURL:String = Contents.config.version_controll_url ; + controlCurrentVersion(); + } + } + + public static function checkVersion():void + { + ME.controlCurrentVersion(true); + } + + private function controlCurrentVersion(useOfflineVersion:Boolean=false):void + { + var versionContrllURL:String = Contents.config.version_controll_url ; SaffronLogger.log("Version controll : "+versionContrllURL); var versionRequest:URLRequest = new URLRequest(versionContrllURL); versionRequest.contentType = 'application/json'; versionRequest.method = URLRequestMethod.POST ; versionRequest.data = JSON.stringify({AppId:DevicePrefrence.appID}) ; - VersionController.controllVersion(currentVersionIsOk,stopThisVersion,versionRequest,DevicePrefrence.appVersion,true); - } + VersionController.controllVersion(currentVersionIsOk,stopThisVersion,versionRequest,DevicePrefrence.appVersion,true,useOfflineVersion); } /**The application version is ok*/ From db3b69e1b6d43f1bb6ac6d0a07a85c88d087cdec Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Mon, 26 Jul 2021 11:18:33 +0430 Subject: [PATCH 41/64] Version control updated --- appManager/mains/AppWithContent.as | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/appManager/mains/AppWithContent.as b/appManager/mains/AppWithContent.as index b78aef3..0e0e7b6 100644 --- a/appManager/mains/AppWithContent.as +++ b/appManager/mains/AppWithContent.as @@ -70,6 +70,8 @@ private static var _contentRect:Rectangle = new Rectangle() ; private static var ME:AppWithContent ; + + private static var showTheOptionalUpateWarning:Boolean = true ; /**Preventor variables*/ private var preventorFunction:Function, @@ -513,6 +515,7 @@ public static function checkVersion():void { + showTheOptionalUpateWarning = true ; ME.controlCurrentVersion(true); } @@ -550,27 +553,26 @@ /**The application is expired*/ private function stopThisVersion(theHint:String,appURL:String,forceToUpdate:Boolean=true):void { - if(isExpired(theHint,appURL,forceToUpdate) && forceToUpdate) + if(forceToUpdate) { + Alert.show(theHint.replace("ID","ID ("+DevicePrefrence.appID+")")); SaffronLogger.log("Switch to the download url instantly"); resetIntro(); stage.removeEventListener(MouseEvent.CLICK,openDownloadLink); stage.addEventListener(MouseEvent.CLICK,openDownloadLink); setTimeout(openDownloadLink,3000); } + else if(showTheOptionalUpateWarning) + { + Alert.show(theHint.replace("ID","ID ("+DevicePrefrence.appID+")")); + showTheOptionalUpateWarning = false ; + setTimeout(openDownloadLink,3000); + } } private function openDownloadLink(event:MouseEvent=null):void { navigateToURL(new URLRequest(VersionController.appStoreURL)); } - - - /**Returns true if there is no listener on this function, so the application have to redirect to the server*/ - protected function isExpired(hint:String,link:String,forceToUpdate:Boolean=true):Boolean - { - Alert.show(hint.replace("ID","ID ("+DevicePrefrence.appID+")")); - return true ; - } } } \ No newline at end of file From c8976d41b3f81763d0e23ce8b0025dc1be9915a6 Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sat, 14 Aug 2021 09:45:33 +0430 Subject: [PATCH 42/64] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bfb5058..7b181bc 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,10 @@ SaffronCode is a collection of codes & libraries for producing powerful and flex SaffronCode is adding to the Adobe Animate environment to build mobile applications output. To get ready the environment, follow these steps: • Install the appropriate version of Adobe Animate • Download SaffronCode SDK +• Download our ASPack libraries to. you need these libraries to be able to use all features on SaffronCode. • ASPack (Collection of key libraries) • Flex and other general swc libraries (if you need soap web services) -• Download the latest version of the Air SDK +• Download the latest version of the Air SDKJDK From 472b4ca1a12d46c9a76246e24b6617b3e5059490 Mon Sep 17 00:00:00 2001 From: mehdi karimpoor Date: Wed, 25 Aug 2021 10:32:28 +0430 Subject: [PATCH 43/64] localnotification updated --- .../localNotification/DistriqtLocalNotification.as | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nativeClasses/localNotification/DistriqtLocalNotification.as b/nativeClasses/localNotification/DistriqtLocalNotification.as index 07f19bb..7c2eb0f 100644 --- a/nativeClasses/localNotification/DistriqtLocalNotification.as +++ b/nativeClasses/localNotification/DistriqtLocalNotification.as @@ -152,16 +152,19 @@ } } - public static function sendMessage(title:String, body:String,date:Date=null,forground:Boolean=true,vibrate:Boolean = true,category:String="MESSAGE_CATEGORY"):void + public static function sendMessage(title:String, body:String,date:Date=null,forground:Boolean=true,vibrate:Boolean = true,category:String="MESSAGE_CATEGORY",newMessageId:int = MessageID):void { init(); if (isSupported()) { service.enableNotificationsWhenActive = forground; if(date==null) - (NotificationsClass as Object).service.notify(new NotificationBuilderClass().setId(MessageID).setAlert(DevicePrefrence.appName).setTitle(title).setBody(body).setCategory(category).enableVibration(vibrate).build()); + (NotificationsClass as Object).service.notify(new NotificationBuilderClass().setId(newMessageId).setAlert(DevicePrefrence.appName).setTitle(title).setBody(body).setCategory(category).enableVibration(vibrate).build()); else - (NotificationsClass as Object).service.notify(new NotificationBuilderClass().setId(MessageID).setAlert(DevicePrefrence.appName).setTitle(title).setBody(body).setCategory(category).enableVibration(vibrate).setFireDate(date).build()) + { + date = new Date(date.time); + (NotificationsClass as Object).service.notify(new NotificationBuilderClass().setId(newMessageId).setAlert(DevicePrefrence.appName).setTitle(title).setBody(body).setCategory(category).enableVibration(vibrate).setFireDate(date).build()) + } } } From 7907a1441d386be13e832c9b62761bc0cb858d8e Mon Sep 17 00:00:00 2001 From: mehdi karimpoor Date: Thu, 2 Sep 2021 18:59:48 +0430 Subject: [PATCH 44/64] =?UTF-8?q?=D8=A7=D8=B5=D9=84=D8=A7=D8=AD=20=D8=A8?= =?UTF-8?q?=D8=B1=D8=A7=DB=8C=20=D9=BE=D8=A7=D9=BE=20=D8=A2=D9=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- popForm/Hints.as | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/popForm/Hints.as b/popForm/Hints.as index b24aa6f..26c44b0 100644 --- a/popForm/Hints.as +++ b/popForm/Hints.as @@ -86,7 +86,8 @@ Alert.show(String(evt.field[credit]));
}
*/ - public static function getText(title:String,question:String,tagLable:String,onDone:Function,OnNotAccepted:Function=null,keyboardType:String=SoftKeyboardType.DEFAULT,isPassword:Boolean=false,innerDisplayObject:DisplayObject=null,ButtonFrameYes:int=1,ButtonFrameNo:int=1,defaultTextOnField:String=''):void + public static function getText(title:String,question:String,tagLable:String,onDone:Function,OnNotAccepted:Function=null,keyboardType:String=SoftKeyboardType.DEFAULT,isPassword:Boolean=false, + innerDisplayObject:DisplayObject=null,ButtonFrameYes:int=1,ButtonFrameNo:int=1,defaultTextOnField:String='',numLine:uint=1):void { controllConfig(); onQuestionAccepted = onDone; @@ -95,7 +96,7 @@ var buttons:Array = [new PopButtonData(Contents.lang.t[id_submit],ButtonFrameYes,null,true,true) ,new PopButtonData(Contents.lang.t[id_back],ButtonFrameNo,null,true,true)] ; var popFields:PopMenuFields = new PopMenuFields(); - popFields.addField(tagLable,defaultTextOnField,keyboardType,isPassword,true,true); + popFields.addField(tagLable,defaultTextOnField,keyboardType,isPassword,true,true,numLine,0,1,0,numLine>1); var popText:PopMenuContent = new PopMenuContent(question,popFields,buttons,innerDisplayObject); PopMenu1.popUp(title,null,popText,0,textCatched); } From 86cc44152f830ae3a59ef6bd1e9057e0494cca37 Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sun, 3 Oct 2021 10:07:16 +0330 Subject: [PATCH 45/64] ASPack and sample project link added. --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7b181bc..3423084 100644 --- a/README.md +++ b/README.md @@ -13,20 +13,21 @@ SaffronCode is a collection of codes & libraries for producing powerful and flex ## You can be an app developer by using Adobe Animate & SaffronCode SDK -• You do not need programming knowledge to be a software developer, you can build a variety of software and brochures without having to write a line of code. You can easily prepare graphical and animated pages in Adobe Animate’s graphic environment for the production of mobile software. -• To use the extensive and diverse libraries in this set, you should only be familiar with Ecma Script 6 or Action Script so you can add calendars, lists, dynamic images and ... to your software. With a higher level of software knowledge, you can easily create a variety of software that connects to a lot of different web services without any hassle of managing Internet access and cache storage. +• You do not need programming knowledge to be a software developer, you can build a variety of software and brochures without having to write a line of code. You can easily prepare graphical and animated pages in Adobe Animate’s graphic environment for the production of mobile software.
+• To use the extensive and diverse libraries in this set, you should only be familiar with Ecma Script 6 or Action Script so you can add calendars, lists, dynamic images and ... to your software. With a higher level of software knowledge, you can easily create a variety of software that connects to a lot of different web services without any hassle of managing Internet access and cache storage.
• Do not worry about managing hardware resources. SaffronCode will optimize your software code to run on mobile devices by using GPU resources. ## How To Start? SaffronCode is adding to the Adobe Animate environment to build mobile applications output. To get ready the environment, follow these steps: -• Install the appropriate version of Adobe Animate -• Download SaffronCode SDK -• Download our ASPack libraries to. you need these libraries to be able to use all features on SaffronCode. -• ASPack (Collection of key libraries) -• Flex and other general swc libraries (if you need soap web services) -• Download the latest version of the Air SDK -• JDK +• Install the appropriate version of Adobe Animate
+• Download SaffronCode SDK
+• Download our ASPack libraries to. you need these libraries to be able to use all features on SaffronCode.
+• Download ASPack
+• Flex and other general swc libraries (if you need soap web services)
+• Download the latest version of the Air SDK
+• JDK
+• Download the sample project here
## Contact Us From af82f004c20b38bcc4d15fbd32640e682b80bde0 Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sun, 3 Oct 2021 12:37:51 +0330 Subject: [PATCH 46/64] No warning and error --- PopMenu1.as | 4 +- PopMenu2.as | 4 +- appManager/animatedPages/MainAnim.as | 6 +-- appManager/animatedPages/Shiner.as | 2 +- .../pageManager/MenuContainer.as | 2 +- .../animatedPages/pageManager/MenuManager.as | 2 +- .../pageManager/PageContainer.as | 2 +- .../animatedPages/pageManager/PageManager.as | 2 +- .../animatedPages/pageManager/TitleManager.as | 2 +- appManager/displayContentElemets/Image.as | 2 +- .../displayContentElemets/LightImage.as | 4 +- appManager/displayContentElemets/TitleText.as | 4 +- appManager/mains/App.as | 2 +- appManager/mains/AppWithContent.as | 4 +- contents/Config.as | 2 +- contents/Contents.as | 24 +++++----- contents/ImageData.as | 6 +-- contents/LinkData.as | 8 ++-- contents/PageData.as | 4 +- contents/multiLanguage/Language.as | 20 ++++---- contents/soundControll/ContentSoundManager.as | 10 ++-- darkBox/BinaryFile.as | 2 +- diagrams/calender/MyShamsi.as | 2 +- nativeClasses/player/BandwidthTester.as | 48 +++++++++---------- nativeClasses/player/DistriqtMediaPlayer.as | 10 ++-- netManager/urlSaver/URLSaver.as | 8 ++-- popForm/Hints.as | 10 ++-- popForm/PopButton.as | 4 +- popForm/PopField.as | 4 +- popForm/PopFieldBoolean.as | 4 +- popForm/PopFieldDate.as | 2 +- popForm/PopFieldTime.as | 2 +- popForm/PopMenu.as | 16 +++---- popForm/PopMenuContenDisplay.as | 22 ++++----- popForm/PopMenuEvent.as | 2 +- popForm/PopMenuFields.as | 14 +++--- popForm/PopMenuTypes.as | 4 +- wrokersJob/WorkerFunctions.as | 4 +- 38 files changed, 137 insertions(+), 137 deletions(-) diff --git a/PopMenu1.as b/PopMenu1.as index da8e1e9..bcc8cc1 100644 --- a/PopMenu1.as +++ b/PopMenu1.as @@ -35,7 +35,7 @@ package staticStageHeight = applicationStageSize ; } - public static function popUp(title:String='' , type:PopMenuTypes=null , content:PopMenuContent=null,closeOnTime:uint=0,onButtonSelects:Function = null,onClosedByTimer:Function=null,onClose:Function=null) + public static function popUp(title:String='' , type:PopMenuTypes=null , content:PopMenuContent=null,closeOnTime:uint=0,onButtonSelects:Function = null,onClosedByTimer:Function=null,onClose:Function=null):void { //SaffronLogger.log('POP 1 MENU OPENED '+Math.random()); //ME1.popUp2(title, type, content,closeOnTime,onButtonSelects); @@ -89,7 +89,7 @@ package { return ME1.popDispatcher ; } - public static function close() + public static function close():void { if(ME1) { diff --git a/PopMenu2.as b/PopMenu2.as index 56b29de..b5e4ec4 100644 --- a/PopMenu2.as +++ b/PopMenu2.as @@ -15,7 +15,7 @@ ME2 = this; } - public static function popUp(title:String='' , type:PopMenuTypes=null , content:PopMenuContent=null,closeOnTime:uint=0,onButtonSelects:Function = null) + public static function popUp(title:String='' , type:PopMenuTypes=null , content:PopMenuContent=null,closeOnTime:uint=0,onButtonSelects:Function = null):void { //SaffronLogger.log('POP 2 MENU OPENED '+Math.random()); ME2.popUp2(title, type, content,closeOnTime,onButtonSelects); @@ -25,7 +25,7 @@ { return ME2.popDispatcher ; } - public static function close() + public static function close():void { if(ME2) ME2.close(); diff --git a/appManager/animatedPages/MainAnim.as b/appManager/animatedPages/MainAnim.as index faca401..b66dff2 100644 --- a/appManager/animatedPages/MainAnim.as +++ b/appManager/animatedPages/MainAnim.as @@ -39,7 +39,7 @@ package appManager.animatedPages } /**animate the frames*/ - private function anim(e:Event,instantMove:Boolean=false) + private function anim(e:Event,instantMove:Boolean=false):void { if(App.skipAnimations || instantMove) { @@ -67,7 +67,7 @@ package appManager.animatedPages } /**take main animation to home frame*/ - public function goHome() + public function goHome():void { currentPage = frame_home ; eventDispatched = false ; @@ -75,7 +75,7 @@ package appManager.animatedPages /**take main menu animation to internal pages frame , it will dispatch app event after animation gone to currect frame
* if you pass true, it will show the page instantly*/ - public function goInternalPage(instantMove:Boolean=false) + public function goInternalPage(instantMove:Boolean=false):void { currentPage = frame_internal ; eventDispatched = false ; diff --git a/appManager/animatedPages/Shiner.as b/appManager/animatedPages/Shiner.as index 7d49399..b9e183c 100644 --- a/appManager/animatedPages/Shiner.as +++ b/appManager/animatedPages/Shiner.as @@ -21,7 +21,7 @@ /**Update shine positions and animation*/ protected function updateShines(event:Event):void { - for(var i = 0 ; i * pass -1 for each dimention to make the original value to use on that side*/ - override public function setUp(imageURL:String, loadInThisArea:Boolean=false, imageW:Number=0, imageH:Number=0, X:Number=0, Y:Number=0,keepRatio:Boolean=true):* + override public function setUp(imageURL:String, loadInThisArea:Boolean=false, imageW:Number=0, imageH:Number=0, X:Number=0, Y:Number=0,keepRatio:Boolean=true):void { //PerformanceTest.traceDelay(1); //SaffronLogger.log("Load this image : "+imageURL); diff --git a/appManager/displayContentElemets/TitleText.as b/appManager/displayContentElemets/TitleText.as index bf037e3..15d725d 100644 --- a/appManager/displayContentElemets/TitleText.as +++ b/appManager/displayContentElemets/TitleText.as @@ -32,7 +32,7 @@ package appManager.displayContentElemets myText.text = ''; } - public function setUp(title:String,arabicText:Boolean = true,splitIfToLong:Boolean=false,resolution:uint=0,replaceWithBitmap:Boolean=true,dynamicWidth:Boolean=false) + public function setUp(title:String,arabicText:Boolean = true,splitIfToLong:Boolean=false,resolution:uint=0,replaceWithBitmap:Boolean=true,dynamicWidth:Boolean=false):void { this.title = title; this.arabicText = arabicText ; @@ -49,7 +49,7 @@ package appManager.displayContentElemets TextPutter.OnButton(myText,title,arabicText,replaceWithBitmap,true,false,resolution,splitIfToLong,dynamicWidth); } /**setup and split text by any car*/ - public function setUp2(title:String,arabicText:Boolean = true,splitIfToLong:Boolean=false,resolution:uint=0,replaceWithBitmap:Boolean=true,splitRange_p:int=0,car_p:String=',',direction_p:String=TitleText.RIGHT,reverse_p:Boolean=false) + public function setUp2(title:String,arabicText:Boolean = true,splitIfToLong:Boolean=false,resolution:uint=0,replaceWithBitmap:Boolean=true,splitRange_p:int=0,car_p:String=',',direction_p:String=TitleText.RIGHT,reverse_p:Boolean=false):void { if(splitRange_p>0) { diff --git a/appManager/mains/App.as b/appManager/mains/App.as index f7c321b..ff90718 100644 --- a/appManager/mains/App.as +++ b/appManager/mains/App.as @@ -299,7 +299,7 @@ /**this function will dispatches whenever intro is over*/ - protected function intoIsOver(e=null):void + protected function intoIsOver(e:*=null):void { introMC.removeEventListener(Intro.EVENT_FINISHED,intoIsOver); Obj.remove(introMC); diff --git a/appManager/mains/AppWithContent.as b/appManager/mains/AppWithContent.as index 0e0e7b6..4064b30 100644 --- a/appManager/mains/AppWithContent.as +++ b/appManager/mains/AppWithContent.as @@ -123,7 +123,7 @@ //Solving Back button on Android 28 DistriqtApplication.solveBackButton(); - stage.addEventListener(MouseEvent.MOUSE_DOWN, function(e):*{ + stage.addEventListener(MouseEvent.MOUSE_DOWN, function(e:*):*{ mouseClickCounter++; }) @@ -203,7 +203,7 @@ NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, URICalled); } - NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE,function(e){ + NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE,function(e:*):void{ SliderManager.hide(true); }) if(!DevicePrefrence.isAndroid() && appDescriptorString.indexOf("NSAllowsArbitraryLoads")==-1) diff --git a/contents/Config.as b/contents/Config.as index f5922e5..b822c17 100644 --- a/contents/Config.as +++ b/contents/Config.as @@ -116,7 +116,7 @@ var loadedXMLString:String = TextFile.load(File.applicationDirectory.resolvePath(configURLFile)); var xml:XML = XML(loadedXMLString); - for(var i = 0 ; i * if your application is supporting multilanguages, you have to use language.xml standart near the content.xml file. and also * you have to set application stage here for the Language class to help it to find added elements to stage.*/ - public static function setUp(OnLoaded:Function=null,supportsMultiLanguage:Boolean=false,autoConvertFontsAndContentTextsByLanguage:Boolean=true,stage:Stage=null,loadConfigFile:Boolean=false) + public static function setUp(OnLoaded:Function=null,supportsMultiLanguage:Boolean=false,autoConvertFontsAndContentTextsByLanguage:Boolean=true,stage:Stage=null,loadConfigFile:Boolean=false):void { onLoaded = OnLoaded ; @@ -118,7 +118,7 @@ } /**This function will controll the langEnabled, so be sure that you are calling it after langEnabled set*/ - private static function loadLang() + private static function loadLang():void { if(langEnabled) { @@ -132,7 +132,7 @@ } /**Load the xml file now*/ - private static function loadXML() + private static function loadXML():void { //SaffronLogger.log("1. debug time : "+getTimer()); /*var fileLoader:FileStream = new FileStream(); @@ -145,7 +145,7 @@ } /**xml file loaded*/ - private static function xmlLoaded(e:Event,myInstantData:String='') + private static function xmlLoaded(e:Event,myInstantData:String=''):void { if(myInstantData!='') { @@ -160,7 +160,7 @@ //Dynamic pages will lost in this mode pages = new Vector.(); - for(var i = 0 ; i(); - for(var i = 0 ; i*/ public function export():XML { - var xml = XML(''); + var xml:XML = XML(''); xml.@id = id; xml.music = musicURL ; @@ -256,7 +256,7 @@ package contents //var link1Node:XML = XML(''); //xml.links = new XML(); - for(var i = 0 ; i * The onCloded function had to get popDataEvent*/ - public static function pleaseWait( onClosed:Function = null ) + public static function pleaseWait( onClosed:Function = null ):void { controllConfig(); var buttons:Array ; diff --git a/popForm/PopButton.as b/popForm/PopButton.as index 60b0de8..2cbddcd 100644 --- a/popForm/PopButton.as +++ b/popForm/PopButton.as @@ -187,7 +187,7 @@ /**add titles that will triggerring the back button*/ - public static function addBackTitleTrigger(backTitle:String) + public static function addBackTitleTrigger(backTitle:String):void { backList.push(backTitle); } @@ -215,7 +215,7 @@ NativeApplication.nativeApplication.removeEventListener(KeyboardEvent.KEY_DOWN,checkBack); } - private function checkBack(e:KeyboardEvent) + private function checkBack(e:KeyboardEvent):void { if(!Obj.getVisible(me) || !Obj.getImOnStage(me)) { diff --git a/popForm/PopField.as b/popForm/PopField.as index 5b53e39..3be2b54 100644 --- a/popForm/PopField.as +++ b/popForm/PopField.as @@ -359,7 +359,7 @@ Y0 = myTXT.height; myTXT.multiline = true ; myTXT.wordWrap = true ; - for(var i = 0 ; i * When this event dispatches from field, you have to detect field id from buttonID value and you can get last field value by using field[buttinID]*/ diff --git a/popForm/PopMenuFields.as b/popForm/PopMenuFields.as index d57847c..c460be8 100644 --- a/popForm/PopMenuFields.as +++ b/popForm/PopMenuFields.as @@ -63,7 +63,7 @@ /**add new field
* frameForDirection: 1 for rtl and 2 for ltr script
* if the field is read only, you can set numLines to 0 and make it change the lines by it's needs*/ - public function addField(tagName:String,fieldDefault:*='',keyBoardType:String = SoftKeyboardType.DEFAULT,isPass:Boolean=false,Editable:Boolean = true,isArabic_v:Boolean=true,numLine:uint=1,frameForDirection:uint=0,fieldColorFrame:uint=1,maxChar:uint=0,MultiLineTag:Boolean=false,Align:Boolean=true) + public function addField(tagName:String,fieldDefault:*='',keyBoardType:String = SoftKeyboardType.DEFAULT,isPass:Boolean=false,Editable:Boolean = true,isArabic_v:Boolean=true,numLine:uint=1,frameForDirection:uint=0,fieldColorFrame:uint=1,maxChar:uint=0,MultiLineTag:Boolean=false,Align:Boolean=true):void { if(frameForDirection==0) { @@ -99,7 +99,7 @@ maxCharacters.push(maxChar); } - public function addRadioListField(tagName:String,popFieldOptions:Array,fieldDefault:*='',isArabic_v:Boolean=true,frameForDirection:uint=1,fieldColorFrame:uint=1,Align:Boolean=true) + public function addRadioListField(tagName:String,popFieldOptions:Array,fieldDefault:*='',isArabic_v:Boolean=true,frameForDirection:uint=1,fieldColorFrame:uint=1,Align:Boolean=true):void { tagNames.push(tagName); if(fieldDefault==null) @@ -124,7 +124,7 @@ maxCharacters.push(0); } - public function addPhoneField(tagName:String,fieldDefault:String='',isArabic_v:Boolean=true,frameForDirection:uint=1,fieldColorFrame:uint=1,isEditable:Boolean=true) + public function addPhoneField(tagName:String,fieldDefault:String='',isArabic_v:Boolean=true,frameForDirection:uint=1,fieldColorFrame:uint=1,isEditable:Boolean=true):void { tagNames.push(tagName); fieldDefaults.push(fieldDefault); @@ -147,7 +147,7 @@ /**add new field
* frameForDirection: 1 for rtl and 2 for ltr script*/ - public function addClickField(tagName:String,fieldDefault:String='',/*keyBoardType:String = SoftKeyboardType.DEFAULT*//*,isPass:Boolean=false*//*,Editable:Boolean = true,*/isArabic_v:Boolean=true,numLine:uint=1,frameForDirection:uint=1,fieldColorFrame:uint=1) + public function addClickField(tagName:String,fieldDefault:String='',/*keyBoardType:String = SoftKeyboardType.DEFAULT*//*,isPass:Boolean=false*//*,Editable:Boolean = true,*/isArabic_v:Boolean=true,numLine:uint=1,frameForDirection:uint=1,fieldColorFrame:uint=1):void { //keyBoardType = (keyBoardType==null)?SoftKeyboardType.DEFAULT:keyBoardType; @@ -172,7 +172,7 @@ /**add new field
* frameForDirection: 1 for rtl and 2 for ltr script*/ - public function addDateField(tagName:String,fieldDefaultDates:Date=null,Editable:Boolean = true,isArabic_v:Boolean=true,frameForDirection:uint=1,fieldColorFrame:uint=1) + public function addDateField(tagName:String,fieldDefaultDates:Date=null,Editable:Boolean = true,isArabic_v:Boolean=true,frameForDirection:uint=1,fieldColorFrame:uint=1):void { //keyBoardType = (keyBoardType==null)?SoftKeyboardType.DEFAULT:keyBoardType; @@ -197,7 +197,7 @@ /**add new field
* frameForDirection: 1 for rtl and 2 for ltr script*/ - public function addBooleanField(tagName:String,booleanValue:Boolean,frameForDirection:uint=1,fieldColorFrame:uint=1,Arabic:Boolean=true) + public function addBooleanField(tagName:String,booleanValue:Boolean,frameForDirection:uint=1,fieldColorFrame:uint=1,Arabic:Boolean=true):void { //keyBoardType = (keyBoardType==null)?SoftKeyboardType.DEFAULT:keyBoardType; tagNames.push(tagName); @@ -221,7 +221,7 @@ /**add new field
* frameForDirection: 1 for rtl and 2 for ltr script*/ - public function addTimeField(tagName:String,fieldDefaultDates:Date=null,Editable:Boolean = true,isArabic_v:Boolean=true,frameForDirection:uint=1,fieldColorFrame:uint=1) + public function addTimeField(tagName:String,fieldDefaultDates:Date=null,Editable:Boolean = true,isArabic_v:Boolean=true,frameForDirection:uint=1,fieldColorFrame:uint=1):void { //keyBoardType = (keyBoardType==null)?SoftKeyboardType.DEFAULT:keyBoardType; diff --git a/popForm/PopMenuTypes.as b/popForm/PopMenuTypes.as index 2a518f5..4d1fe2c 100644 --- a/popForm/PopMenuTypes.as +++ b/popForm/PopMenuTypes.as @@ -23,13 +23,13 @@ } /**this is a answer type of pop ups*/ - public static function get DEFAULT() + public static function get DEFAULT():PopMenuTypes { return new PopMenuTypes(1/*,0xFF33CC*/); } /**this is a question type of pop ups*/ - public static function get CAUTION() + public static function get CAUTION():PopMenuTypes { return new PopMenuTypes(2/*,0x00cc00*/); } diff --git a/wrokersJob/WorkerFunctions.as b/wrokersJob/WorkerFunctions.as index 08cb676..1d5f88f 100644 --- a/wrokersJob/WorkerFunctions.as +++ b/wrokersJob/WorkerFunctions.as @@ -118,7 +118,7 @@ var receiverChannel:MessageChannel = worker.createMessageChannel(Worker.current); receiverChannel.addEventListener(Event.CHANNEL_MESSAGE, handlecustomeChannel); //receiverChannel.addEventListener(Event.DEACTIVATE, workerDeactivated); - receiverChannel.addEventListener(Event.CHANNEL_STATE, function(e:Event){SaffronLogger.log(e)}); + receiverChannel.addEventListener(Event.CHANNEL_STATE, function(e:Event):void{SaffronLogger.log(e)}); worker.setSharedProperty("receiverChannel_fromMainProject", receiverChannel); worker.start(); @@ -166,7 +166,7 @@ } /**Worker state*/ - private static function workerStateHandler(e:Event) { + private static function workerStateHandler(e:Event):void { var worker:Worker = e.currentTarget as Worker ; SaffronLogger.log("Worker State : "+worker.state); if(worker.state == WorkerState.RUNNING) From 8d1ebb0a954d640ba1c35bd8113d5cad62015cd6 Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sat, 9 Oct 2021 08:56:31 +0330 Subject: [PATCH 47/64] Sound volume auto change --- appManager/mains/App.as | 4 ++++ contents/soundControll/ContentSoundManager.as | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/appManager/mains/App.as b/appManager/mains/App.as index ff90718..b26a008 100644 --- a/appManager/mains/App.as +++ b/appManager/mains/App.as @@ -381,6 +381,10 @@ { ContentSoundManager.changeMainMusic((event as AppEventContent).pageData.musicURL,(event as AppEventContent).pageData.musicVolume); } + else + { + ContentSoundManager.changeVolume((event as AppEventContent).pageData.musicVolume); + } if(mainAnim == null) diff --git a/contents/soundControll/ContentSoundManager.as b/contents/soundControll/ContentSoundManager.as index 15d6ae8..283ca54 100644 --- a/contents/soundControll/ContentSoundManager.as +++ b/contents/soundControll/ContentSoundManager.as @@ -97,6 +97,11 @@ package contents.soundControll { SoundPlayer.volumeContril(currentSoundId,1); } + + public static function changeVolume(volume:Number):void + { + SoundPlayer.volumeContril(currentSoundId,volume); + } /**This will change the current playing music ( not tested yet )*/ public static function changeMainMusic(musicURL:String='',volume:Number=1):void From 38e47cdec8ecdb1fad07567ea71adb7170a9382c Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sat, 9 Oct 2021 08:56:36 +0330 Subject: [PATCH 48/64] Create RandomFrameClipPlay.as --- movieClipAssist/RandomFrameClipPlay.as | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 movieClipAssist/RandomFrameClipPlay.as diff --git a/movieClipAssist/RandomFrameClipPlay.as b/movieClipAssist/RandomFrameClipPlay.as new file mode 100644 index 0000000..280a929 --- /dev/null +++ b/movieClipAssist/RandomFrameClipPlay.as @@ -0,0 +1,16 @@ + +package movieClipAssist +//movieClipAssist.RandomFrameClipPlay +{ + import flash.display.MovieClip; + import contents.alert.Alert; + + public class RandomFrameClipPlay extends MovieClip + { + public function RandomFrameClipPlay() + { + super(); + this.gotoAndPlay(Math.floor(Math.random()*this.totalFrames+1)); + } + } +} \ No newline at end of file From 7e0fdcb828b52592cb138d5938030f9e2e3f4ed6 Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sat, 9 Oct 2021 08:56:40 +0330 Subject: [PATCH 49/64] Update DistriqtAudioPlayer.as --- nativeClasses/player/DistriqtAudioPlayer.as | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nativeClasses/player/DistriqtAudioPlayer.as b/nativeClasses/player/DistriqtAudioPlayer.as index 08142e0..33eca6e 100644 --- a/nativeClasses/player/DistriqtAudioPlayer.as +++ b/nativeClasses/player/DistriqtAudioPlayer.as @@ -25,7 +25,7 @@ import contents.alert.Alert; - public class DistriqtMediaPlayer extends Sprite + public class DistriqtAudioPlayer extends Sprite { private var isFullScreen:Boolean = false; @@ -82,7 +82,7 @@ private var checkQuailyID:int; private var checkSeekID:int; - public function DistriqtMediaPlayer(Width:Number, Height:Number) + public function DistriqtAudioPlayer(Width:Number, Height:Number) { super(); if (myDistriqtId == null) From d3042455d79aa2bc46a5f49a0ac1bb00f15239c1 Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sun, 10 Oct 2021 09:19:58 +0330 Subject: [PATCH 50/64] Create StopAtEnd.as --- movieClipAssist/StopAtEnd.as | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 movieClipAssist/StopAtEnd.as diff --git a/movieClipAssist/StopAtEnd.as b/movieClipAssist/StopAtEnd.as new file mode 100644 index 0000000..0afa704 --- /dev/null +++ b/movieClipAssist/StopAtEnd.as @@ -0,0 +1,20 @@ + +package movieClipAssist +//movieClipAssist.StopAtEnd +{ + import flash.display.MovieClip; + + public class StopAtEnd extends MovieClip + { + public function StopAtEnd() + { + super(); + this.addFrameScript(this.totalFrames-1,stopMe); + } + + private function stopMe():void + { + this.stop(); + } + } +} \ No newline at end of file From 910d4dc5bfc77c1ede163e0d7b4694cfbed91f63 Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sun, 17 Oct 2021 21:01:02 +0330 Subject: [PATCH 51/64] On popmuenu opened trigger --- popForm/PopMenu.as | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/popForm/PopMenu.as b/popForm/PopMenu.as index 4fa5fe7..5bcfe3c 100644 --- a/popForm/PopMenu.as +++ b/popForm/PopMenu.as @@ -34,6 +34,8 @@ public class PopMenu extends MovieClip { private static const CANCEL_ELEMENT_NAME:String = "cancel_mc" ; + + private static var onPopUpOpenned:Function ; /**main object of class*/ private static var ME:PopMenu; @@ -101,6 +103,11 @@ { backButtonName = backString ; } + + public static function onOpen(func:Function):void + { + onPopUpOpenned = func ; + } /**Activate the static cansel button*/ public static function staticCanselEnabled(CancelNames:Array):void @@ -383,6 +390,7 @@ /**pop the pop menu up*/ public function popUp2(title:String='' , type:PopMenuTypes=null , content:PopMenuContent=null,closeOnTime:int=0,onButtonSelects:Function=null,onClosedByTimer:Function=null,onClose:Function=null):void { + if(onPopUpOpenned!=null)onPopUpOpenned(); SliderManager.hide(); cashedContents = content ; From e891f8ec814a2300ad9175181a80257b3df19108 Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sun, 17 Oct 2021 23:26:43 +0330 Subject: [PATCH 52/64] onChanged added to switch button --- appManager/displayObjects/SwitchButtonAnimated.as | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/appManager/displayObjects/SwitchButtonAnimated.as b/appManager/displayObjects/SwitchButtonAnimated.as index 1984c8d..808100c 100644 --- a/appManager/displayObjects/SwitchButtonAnimated.as +++ b/appManager/displayObjects/SwitchButtonAnimated.as @@ -11,6 +11,8 @@ { private var _status:Boolean = false ; + private var onChangeFunction:Function ; + public function SwitchButtonAnimated(status:Boolean = false) { _status = status ; @@ -23,6 +25,11 @@ this.addEventListener(Event.REMOVED_FROM_STAGE,unLoad); } + public function onChanged(func:Function):void + { + onChangeFunction = func ; + } + private function unLoad(e:Event):void { this.removeEventListener(MouseEvent.MOUSE_DOWN,switchMe); @@ -35,6 +42,7 @@ _status = !_status ; this.dispatchEvent(new Event(Event.CHANGE)); SaffronLogger.log(_status); + if(onChangeFunction!=null)onChangeFunction(); } public function get status():Boolean @@ -50,6 +58,13 @@ } } + public function setInstantStaut(status:Boolean):void + { + _status = status; + if(status)this.gotoAndStop(this.totalFrames); + else this.gotoAndStop(1); + } + private function anim(event:Event):void { if(_status) From 526dc9942aa9482760554d3a30f626c01a23195a Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sun, 17 Oct 2021 23:27:14 +0330 Subject: [PATCH 53/64] ContentSoundManager upgraded --- contents/soundControll/ContentSoundManager.as | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/contents/soundControll/ContentSoundManager.as b/contents/soundControll/ContentSoundManager.as index 283ca54..75b9f97 100644 --- a/contents/soundControll/ContentSoundManager.as +++ b/contents/soundControll/ContentSoundManager.as @@ -21,6 +21,8 @@ package contents.soundControll private static var lastPlayingMusic:String ; private static var lastMusicVolume:Number ; + + private static var muted:Boolean = false ; /**2 sound id to swap musics smoothly*/ private static var currentSoundId:uint, @@ -59,7 +61,7 @@ package contents.soundControll var soundPose:Number = SoundPlayer.getPlayedPrecent(currentSoundId); pauseMusic(); SoundMixer.stopAll(); - SoundPlayer.addSound(lastPlayingMusic,currentSoundId,true,lastMusicVolume); + SoundPlayer.addSound(lastPlayingMusic,currentSoundId,true,muted?0:lastMusicVolume); if(firstSoundPlaying) { startMusic(soundPose); @@ -75,10 +77,11 @@ package contents.soundControll else { SaffronLogger.log("soundPose : "+soundPlayingFrom); - SoundPlayer.play(currentSoundId,true,true,soundPlayingFrom); } + SoundPlayer.play(currentSoundId,true,true,soundPlayingFrom); lastMusicState.data.state = true ; lastMusicState.flush(); + if(muted)SoundPlayer.volumeContril(currentSoundId,0); } public static function pauseMusic():void @@ -90,17 +93,19 @@ package contents.soundControll public static function muteMusic():void { + muted = true ; SoundPlayer.volumeContril(currentSoundId,0); } public static function unMuteMusit():void { + muted = false SoundPlayer.volumeContril(currentSoundId,1); } public static function changeVolume(volume:Number):void { - SoundPlayer.volumeContril(currentSoundId,volume); + SoundPlayer.volumeContril(currentSoundId,muted?0:volume); } /**This will change the current playing music ( not tested yet )*/ @@ -115,7 +120,7 @@ package contents.soundControll volume = Contents.homePage.musicVolume ; } lastMusicVolume = volume ; - if(musicURL=='' || lastPlayingMusic == musicURL) + if(muted==false && (musicURL=='' || lastPlayingMusic == musicURL)) { SaffronLogger.log("Music is duplicated on ContentSoundManager.changeMainMusic : "+musicURL); SoundPlayer.volumeContril(currentSoundId,volume); @@ -128,13 +133,15 @@ package contents.soundControll SaffronLogger.log("Pause the sound : "+currentSoundId); SoundPlayer.pause(currentSoundId); SaffronLogger.log("Add the sound : "+otherSoundId); - SoundPlayer.addSound(musicURL,otherSoundId,true,volume); + SoundPlayer.addSound(musicURL,otherSoundId,true,muted?0:volume); if(lastPlayingMusic==null || musicWasPlaying) { SaffronLogger.log("lastPlayingMusic : "+lastPlayingMusic); SaffronLogger.log("musicWasPlaying : "+musicWasPlaying); SoundPlayer.play(otherSoundId); + } + if(muted)SoundPlayer.volumeContril(currentSoundId,0); lastPlayingMusic = musicURL ; From be481091d546d2a8f7b989cafc57351ea6f8fac4 Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Mon, 1 Nov 2021 13:26:30 +0330 Subject: [PATCH 54/64] Title manager upgradedd --- appManager/animatedPages/pageManager/TitleManager.as | 1 + 1 file changed, 1 insertion(+) diff --git a/appManager/animatedPages/pageManager/TitleManager.as b/appManager/animatedPages/pageManager/TitleManager.as index 8fd115c..2ee6d46 100644 --- a/appManager/animatedPages/pageManager/TitleManager.as +++ b/appManager/animatedPages/pageManager/TitleManager.as @@ -113,6 +113,7 @@ /**Set the title both for parags and titletexts*/ public function setTitle(text:String):void { + this.visible = text!=''; if(myTitle!=null) { if(myTitle.text != text) From 7c116af960698d8b64ee0005965b89271c1e7cdb Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Mon, 1 Nov 2021 13:26:47 +0330 Subject: [PATCH 55/64] PageControll event updated --- appManager/event/PageControllEvent.as | 5 ++- appManager/mains/AppWithContent.as | 44 ++++++++++++++------------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/appManager/event/PageControllEvent.as b/appManager/event/PageControllEvent.as index c6b3d29..1bb4af5 100644 --- a/appManager/event/PageControllEvent.as +++ b/appManager/event/PageControllEvent.as @@ -23,14 +23,17 @@ package appManager.event public var preventerPage:DisplayObject ; public var let_cashed_requested_page_activate:Boolean = true ; + + public var ignorelastCalledPage:Boolean = false ; /**Feel the getPermition and preventerDisplayObject on PREVENT_PAGE_CHANGING event*/ - public function PageControllEvent(type:String,getPermition:Function=null,preventerDisplayObject:DisplayObject=null,let_requested_page_to_open:Boolean=true) + public function PageControllEvent(type:String,getPermition:Function=null,preventerDisplayObject:DisplayObject=null,let_requested_page_to_open:Boolean=true,ignorelastCalledPage:Boolean=false) { super(type,true); let_cashed_requested_page_activate = let_requested_page_to_open; permitionReceiver = getPermition ; preventerPage = preventerDisplayObject ; + this.ignorelastCalledPage = ignorelastCalledPage ; } } } \ No newline at end of file diff --git a/appManager/mains/AppWithContent.as b/appManager/mains/AppWithContent.as index 4064b30..d421140 100644 --- a/appManager/mains/AppWithContent.as +++ b/appManager/mains/AppWithContent.as @@ -372,7 +372,7 @@ } prventedPageWasLastPage = false ; - if(preventedEventCash!=null) + if(preventedEventCash!=null && !event.ignorelastCalledPage) { SaffronLogger.log("Prevented page event is released"); managePages(preventedEventCash); @@ -486,19 +486,20 @@ /**Save teh page ID to Analytic server */ private function logPageChange(pageId:String):void { - if(pageLoggerRequest==null) - { - pageLoggerRequest = new URLRequest(Contents.config.version_controll_url); - pageLoggerRequest.contentType = 'application/json'; - pageLoggerRequest.method = URLRequestMethod.POST ; - } - pageLoggerRequest.data = JSON.stringify({AppId:DevicePrefrence.appID,PageName:pageId,Enter:true}) ; - if(pageLoggerLoader==null) - { - pageLoggerLoader = new URLLoader(); - pageLoggerLoader.addEventListener(IOErrorEvent.IO_ERROR,function():void{}) - } - pageLoggerLoader.load(pageLoggerRequest); + //GOODBY Saffron Logger... we will miss you + // if(pageLoggerRequest==null) + // { + // pageLoggerRequest = new URLRequest(Contents.config.version_controll_url); + // pageLoggerRequest.contentType = 'application/json'; + // pageLoggerRequest.method = URLRequestMethod.POST ; + // } + // pageLoggerRequest.data = JSON.stringify({AppId:DevicePrefrence.appID,PageName:pageId,Enter:true}) ; + // if(pageLoggerLoader==null) + // { + // pageLoggerLoader = new URLLoader(); + // pageLoggerLoader.addEventListener(IOErrorEvent.IO_ERROR,function():void{}) + // } + // pageLoggerLoader.load(pageLoggerRequest); } @@ -521,14 +522,15 @@ private function controlCurrentVersion(useOfflineVersion:Boolean=false):void { - var versionContrllURL:String = Contents.config.version_controll_url ; - SaffronLogger.log("Version controll : "+versionContrllURL); - var versionRequest:URLRequest = new URLRequest(versionContrllURL); - versionRequest.contentType = 'application/json'; - versionRequest.method = URLRequestMethod.POST ; - versionRequest.data = JSON.stringify({AppId:DevicePrefrence.appID}) ; + //GOODBY Saffron analytics, we will miss you + // var versionContrllURL:String = Contents.config.version_controll_url ; + // SaffronLogger.log("Version controll : "+versionContrllURL); + // var versionRequest:URLRequest = new URLRequest(versionContrllURL); + // versionRequest.contentType = 'application/json'; + // versionRequest.method = URLRequestMethod.POST ; + // versionRequest.data = JSON.stringify({AppId:DevicePrefrence.appID}) ; - VersionController.controllVersion(currentVersionIsOk,stopThisVersion,versionRequest,DevicePrefrence.appVersion,true,useOfflineVersion); + // VersionController.controllVersion(currentVersionIsOk,stopThisVersion,versionRequest,DevicePrefrence.appVersion,true,useOfflineVersion); } /**The application version is ok*/ From efcac2dd755797fd534337b78d3dee1a27d9a8b2 Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Mon, 1 Nov 2021 13:27:24 +0330 Subject: [PATCH 56/64] Callback functions improved on Hins --- popForm/Hints.as | 4 +++- popForm/PopField.as | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/popForm/Hints.as b/popForm/Hints.as index 216a4e3..91b7488 100644 --- a/popForm/Hints.as +++ b/popForm/Hints.as @@ -177,7 +177,9 @@ { if(_onClose!=null) { - _onClose.call(); + var cahsedhCloseFunc:Function = _onClose ; + _onClose = null ; + cahsedhCloseFunc(); } } diff --git a/popForm/PopField.as b/popForm/PopField.as index 3be2b54..c952308 100644 --- a/popForm/PopField.as +++ b/popForm/PopField.as @@ -234,9 +234,10 @@ } } - public function onEdited(func:Function):void + public function onEdited(func:Function):PopField { onEditedFunc = func ; + return this ; } public function setUp(tagName:String,defaultText:String,KeyBordType:String = SoftKeyboardType.DEFAULT,isPass:Boolean = false,editable:Boolean = true,isAraic:Boolean=true,numLines:uint = 1,color:uint=1,frame:uint=1,maxChar:uint=0,otherOptions:Array=null,deleteDefautlText:Boolean=false,activateRadioSwitcher:Boolean=false,returnKey:String=ReturnKeyLabel.DEFAULT,onTypedFunction:Function=null,justShowNativeText:Boolean=false,multiLineTag:Boolean=false,justify:Boolean=true,selectAllCharchter:Boolean=false):PopField @@ -505,7 +506,10 @@ private function callOnEditedFunc():void { clearTimeout(onEditeFuncCalDelay); - onEditeFuncCalDelay = setTimeout(callOnEditedNow,100); + if(onEditedFunc!=null) + { + onEditeFuncCalDelay = setTimeout(callOnEditedNow,100); + } } private function callOnEditedNow():void { From 67cc208bf0bd1b34301895d1deb7560dc64279f9 Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Thu, 18 Nov 2021 20:32:32 +0330 Subject: [PATCH 57/64] Update Anim_alpha_shine.as --- animation/Anim_alpha_shine.as | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/animation/Anim_alpha_shine.as b/animation/Anim_alpha_shine.as index 7d49a6e..81efa63 100644 --- a/animation/Anim_alpha_shine.as +++ b/animation/Anim_alpha_shine.as @@ -10,9 +10,11 @@ import flash.events.EventDispatcher; public class Anim_alpha_shine extends Sprite{ - var object:Object ; + private var object:Object ; - var I:Number ; + private var I:Number ; + + private var _paused:Boolean = false ; public function Anim_alpha_shine(displayObject:Object) { this.addEventListener(Event.ENTER_FRAME,animate); @@ -37,8 +39,19 @@ public class Anim_alpha_shine extends Sprite{ object.alpha = 1 ; } + public function pauseShine():void + { + _paused = true ; + } + + public function playShine():void + { + _paused = false ; + } + private function animate(e:Event):void { + if(_paused)return; object.alpha = 1-(Math.cos(I)+1)/4 ; I+=0.1; } From 7b17304b9eceadb5bc1f55cd9fbacf6a2c6b5dac Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Fri, 19 Nov 2021 14:03:56 +0330 Subject: [PATCH 58/64] No network emulator on RestDoa --- restDoaService/RestDoaServiceCaller.as | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/restDoaService/RestDoaServiceCaller.as b/restDoaService/RestDoaServiceCaller.as index a8620cc..883b0f1 100644 --- a/restDoaService/RestDoaServiceCaller.as +++ b/restDoaService/RestDoaServiceCaller.as @@ -61,6 +61,7 @@ private static var webServiceId:uint = 0 ; + private static var _fake_no_net:Boolean = false ; public function get pureData():String { @@ -158,6 +159,11 @@ requestLoader.addEventListener(ProgressEvent.PROGRESS,dispatchProgress); } + public static function cutConnect(status:Boolean=true):void + { + _fake_no_net = status ; + } + public function then(onResponded:Function):RestDoaServiceCaller { resultReturnedFunc = onResponded ; @@ -583,7 +589,16 @@ //debug line //navigateToURL(pureRequest); _isLoading = true ; - requestLoader.load(pureRequest); + if(_fake_no_net) + { + setTimeout(function():void{ + requestLoader.dispatchEvent(new IOErrorEvent(IOErrorEvent.IO_ERROR,true,false,'no net')); + },100) + } + else + { + requestLoader.load(pureRequest); + } //noInternet(); } From a220a8e9c0f84dd1f7677ec77e8a7592d9eb07f4 Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Fri, 10 Dec 2021 17:52:44 +0330 Subject: [PATCH 59/64] UDP message send and receive function --- netManager/UDPManager.as | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 netManager/UDPManager.as diff --git a/netManager/UDPManager.as b/netManager/UDPManager.as new file mode 100644 index 0000000..f4c963b --- /dev/null +++ b/netManager/UDPManager.as @@ -0,0 +1,56 @@ +package netManager +{ + import flash.net.DatagramSocket; + import flash.utils.ByteArray; + import flash.events.DatagramSocketDataEvent; + + public class UDPManager + { + private static var myUDP:DatagramSocket ; + + private static var onReceiveFunction:Function ; + + private static function setUp():void + { + if(myUDP==null) + { + myUDP = new DatagramSocket(); + myUDP.addEventListener(DatagramSocketDataEvent.DATA,onDataReceived); + } + } + + private static function onDataReceived(e:DatagramSocketDataEvent):void + { + trace("Message received"); + var message:String = e.data.toString(); + if(onReceiveFunction!=null && onReceiveFunction.length>0) + onReceiveFunction(message) + } + + private static function getMessageOnPort(onRespond:Function,myPort:uint=43243):void + { + trace("myUDP.connected : "+myUDP.connected); + trace("myUDP.localPort : " +myUDP.localPort); + onReceiveFunction = onRespond ; + if(myUDP.localPort==0 || ( myUDP.localPort!=myPort && myPort!=43243)) + { + if(myUDP.connected) + myUDP.close(); + + myUDP.bind(myPort); + myUDP.receive(); + } + } + + public static function sendMessageTo(message:String,onRespond:Function,targetIp:String,targetPort:uint):void + { + setUp(); + trace("Message sent:"+message); + getMessageOnPort(onRespond); + var data:ByteArray = new ByteArray(); + data.writeUTFBytes(message); + myUDP.send(data,0,0,targetIp,targetPort); + myUDP.receive(); + } + } +} \ No newline at end of file From f06664c558d1ba13d65050024eea0552e114ec4c Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sat, 18 Dec 2021 12:03:36 +0330 Subject: [PATCH 60/64] You can set the local binded port --- netManager/UDPManager.as | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/netManager/UDPManager.as b/netManager/UDPManager.as index f4c963b..c68cf61 100644 --- a/netManager/UDPManager.as +++ b/netManager/UDPManager.as @@ -27,12 +27,12 @@ package netManager onReceiveFunction(message) } - private static function getMessageOnPort(onRespond:Function,myPort:uint=43243):void + private static function getMessageOnPort(onRespond:Function,myPort:uint):void { trace("myUDP.connected : "+myUDP.connected); trace("myUDP.localPort : " +myUDP.localPort); onReceiveFunction = onRespond ; - if(myUDP.localPort==0 || ( myUDP.localPort!=myPort && myPort!=43243)) + if(myUDP.localPort==0 || ( myUDP.localPort!=myPort)) { if(myUDP.connected) myUDP.close(); @@ -42,11 +42,16 @@ package netManager } } - public static function sendMessageTo(message:String,onRespond:Function,targetIp:String,targetPort:uint):void + public static function isConnected():Boolean + { + return myUDP.connected && myUDP.localPort !=0; + } + + public static function sendMessageTo(message:String,onRespond:Function,targetIp:String,targetPort:uint,localPort:uint=2000):void { setUp(); trace("Message sent:"+message); - getMessageOnPort(onRespond); + getMessageOnPort(onRespond,localPort); var data:ByteArray = new ByteArray(); data.writeUTFBytes(message); myUDP.send(data,0,0,targetIp,targetPort); From 21ec0982300c324b27ae28bcbb6e03dc9b354f1f Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sat, 18 Dec 2021 12:09:11 +0330 Subject: [PATCH 61/64] Update UDPManager.as --- netManager/UDPManager.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netManager/UDPManager.as b/netManager/UDPManager.as index c68cf61..6f209ad 100644 --- a/netManager/UDPManager.as +++ b/netManager/UDPManager.as @@ -27,7 +27,7 @@ package netManager onReceiveFunction(message) } - private static function getMessageOnPort(onRespond:Function,myPort:uint):void + public static function getMessageOnPort(onRespond:Function,myPort:uint):void { trace("myUDP.connected : "+myUDP.connected); trace("myUDP.localPort : " +myUDP.localPort); From b200c8bdcd5ba502acac24818a4459087c461c6e Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Sat, 25 Dec 2021 08:25:36 +0330 Subject: [PATCH 62/64] getLastConnectionTimeout() on UDPManager --- netManager/UDPManager.as | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/netManager/UDPManager.as b/netManager/UDPManager.as index 6f209ad..3a5c31c 100644 --- a/netManager/UDPManager.as +++ b/netManager/UDPManager.as @@ -3,6 +3,7 @@ package netManager import flash.net.DatagramSocket; import flash.utils.ByteArray; import flash.events.DatagramSocketDataEvent; + import flash.utils.getTimer; public class UDPManager { @@ -10,6 +11,8 @@ package netManager private static var onReceiveFunction:Function ; + private static var lastMassageDeliveryTime:int ; + private static function setUp():void { if(myUDP==null) @@ -22,6 +25,7 @@ package netManager private static function onDataReceived(e:DatagramSocketDataEvent):void { trace("Message received"); + lastMassageDeliveryTime = getTimer(); var message:String = e.data.toString(); if(onReceiveFunction!=null && onReceiveFunction.length>0) onReceiveFunction(message) @@ -57,5 +61,11 @@ package netManager myUDP.send(data,0,0,targetIp,targetPort); myUDP.receive(); } + + /**Returns the last time that connection accured */ + public function getLastConnectionTimeout():int + { + return getTimer()-lastMassageDeliveryTime; + } } } \ No newline at end of file From 7182f1132a1b7c9612c2286f03990cb7e686fc85 Mon Sep 17 00:00:00 2001 From: "Mohammad E. Sepehr" Date: Tue, 26 Dec 2023 01:49:17 -0800 Subject: [PATCH 63/64] some warnings removed --- dataManager/SavedDatas2.as | 10 +++++----- drawPad/Paper.as | 14 +++++++------- notification/NotificationEvent.as | 4 ++-- notification/NotificationManager.as | 2 +- photoEditor/EditorPencil.as | 4 ++-- photoEditor/PhotoEdit.as | 4 ++-- photoEditor/StampList.as | 4 ++-- restDoaService/RestDoaServiceCaller.as | 4 ++-- tabMenu/TabMenuManager.as | 2 +- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dataManager/SavedDatas2.as b/dataManager/SavedDatas2.as index eb79afa..3823db5 100644 --- a/dataManager/SavedDatas2.as +++ b/dataManager/SavedDatas2.as @@ -67,7 +67,7 @@ } /**Change the table name for this special user*/ - public static function setTableName(tableNameTitle:String='') + public static function setTableName(tableNameTitle:String=''):void { tableName = tableBaseName+tableNameTitle; SaffronLogger.log("new table name is : "+tableName); @@ -78,7 +78,7 @@ - public static function setUp(checkTable:Boolean = false) + public static function setUp(checkTable:Boolean = false):void { var needToUpdate:Boolean = false ; if(sql == null) @@ -256,7 +256,7 @@ asyncQuery.execute(); } - private static function continueSaving(e:*=null) + private static function continueSaving(e:*=null):void { var id:String = asyncQue[0].id ; var data:* = asyncQue[0].data ; @@ -283,7 +283,7 @@ } /**load the value if the value is new on data base*/ - public static function loadIfNewer(id,lastDate:Date=null):* + public static function loadIfNewer(id:*,lastDate:Date=null):* { return load(id,lastDate); } @@ -298,7 +298,7 @@ var l:uint = asyncQue.length ; var l2:uint = asyncSaved.length ; - for(var i = l-1 ; i>=0 ; i--) + for(var i:* = l-1 ; i>=0 ; i--) { if(asyncQue[i].id == id) { diff --git a/drawPad/Paper.as b/drawPad/Paper.as index 5bd84d4..1041336 100644 --- a/drawPad/Paper.as +++ b/drawPad/Paper.as @@ -130,7 +130,7 @@ this.addEventListener(Event.REMOVED_FROM_STAGE,unLoad); } - private function unLoad(event:Event) + private function unLoad(event:Event):void { this.removeEventListener(Event.ENTER_FRAME,drawLines); this.removeEventListener(Event.REMOVED_FROM_STAGE,unLoad); @@ -163,11 +163,11 @@ } - private function drawLines(ev:Event=null) + private function drawLines(ev:Event=null):void { if(draw) { - for(var i = 0 ; i = imageHistory.splice(imageIndex+1,imageHistory.length-imageIndex); - for(var i = 0 ; i Date: Mon, 12 Feb 2024 10:03:11 +0330 Subject: [PATCH 64/64] Don't need to encode logs any more. this is an open source SDK for public uses now --- SaffronLogger.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SaffronLogger.as b/SaffronLogger.as index 02ece41..7a326dc 100644 --- a/SaffronLogger.as +++ b/SaffronLogger.as @@ -120,7 +120,7 @@ package trace("Log file located on "+todayFile.nativePath); todayFileStream = new FileStream(); todayFileStream.openAsync(todayFile,FileMode.WRITE); - todayFileStream.writeShort(-2); + // todayFileStream.writeShort(-2); } }