[ ivanpro @ 27.10.2011. 21:35 ] @
Pozdrav Skinuo sam neki .xml template u kome je nedovrsena kontakt forma. Radi u kombinaciji sa .swf. Evo .xml fajla pa ako moze pomoc. fake.txt ne postoji ? Hvala |
[ ivanpro @ 27.10.2011. 21:35 ] @
[ MenOfHonor @ 27.10.2011. 22:21 ] @
Po nazivu taga koji ima rekao bih da bi to trebao da bude php fajl (iako je za atribut src navedena vrednost "fake.txt" što ukazuje na tekstualni fajl):
Code: <phpFile src="fake.txt"/> Sve ostalo je prilično jasno: u atributima settings taga definišeš stil forme, a u ostalim tagovima određuješ tekst koji će se prikazivati na njenim poljima. Znači da ti nedostaje php fajl koji će prikupiti podatke sa forme i prosediti ga dalje. U "contact" klasi u metodi "sendMassage" deklarisana je promenljiva "loc8" koja predstavlja URLRequest objekat kojim se poziva pomenuti fajl "fake.txt" iz XML-a: Code: loc8 = new flash.net.URLRequest(this._xml.child("phpFile").src); Promenljive koje se iz flasha šalju trebao bi da učita php. Taj fajl bi mogao da izgleda ovako: Code: <?php $ime = $_POST["senderName"]; $email = $_POST["senderEmail"]; $naslovPoruke = $_POST["senderSubject"]; $poruka = $_POST["senderMessage"]; $zaglavlje = "From: " . $ime . "<" . $email .">\r\n"; $zaglavlje .= "Reply-To: " . $email . "\r\n"; $zaglavlje .= "Return-path: " . $email; mail($ime, $naslovPoruke, $poruka, $zaglavlje); ?> [ ivanpro @ 27.10.2011. 23:19 ] @
Hvala na brzom odgovoru.
Reci mi samo da li fajl treba da bude fake.txt ili fake.php, jer sam ja probao sa nekim php, ali ocigledano nisam pogodio parametre. I da li u ovom primeru koji si mi dao treba negde da upisem moj email ili je to u okviru contact.xml fajla (treca linija odozdo). Hvala [ MenOfHonor @ 27.10.2011. 23:26 ] @
Možeš ga nazvati kako god hoćeš samo ne zaboravi da u tom slučaju izmeniš i naziv u XML fajlu.
[ ivanpro @ 27.10.2011. 23:30 ] @
Ne radi ???
Probao sam oba (php i txt). Dali imas ideju zasto? ![]() [Ovu poruku je menjao ivanpro dana 28.10.2011. u 00:56 GMT+1] [ MenOfHonor @ 28.10.2011. 15:35 ] @
Trebao bi da dodaš sendToURL() metod kako bi poslao te promenljive php-u:
Code: sendToURL(loc8) Znači, to bi trebao da dodaš u "Contact" klasu u metod "sendMessage()": Code: private function sendMessage(arg1:flash.events.MouseEvent):void { var loc7:*; loc7 = null; var loc8:*; loc8 = null; var loc9:*; loc9 = null; var loc1:*; loc1 = this._nameArea.textArea.text; var loc2:*; loc2 = this._emailArea.textArea.text; var loc3:*; loc3 = this._subjectArea.textArea.text; var loc4:*; loc4 = this._messageArea.textArea.text; var loc5:*; loc5 = this._xml.child("companyEmail"); var loc6:*; loc6 = this._xml.child("siteName"); if (this.validateEmail(loc2)) { loc7 = new flash.net.URLLoader(); loc8 = new flash.net.URLRequest(this._xml.child("phpFile").src); loc9 = new flash.net.URLVariables(); loc7.dataFormat = flash.net.URLLoaderDataFormat.VARIABLES; loc8.method = flash.net.URLRequestMethod.POST; loc9.senderName = loc1; loc9.senderEmail = loc2; loc9.senderSubject = loc3; loc9.senderMessage = loc4; loc9.companyEmail = loc5; loc9.siteName = loc6; loc8.data = loc9; sendToURL(loc8) loc7.load(loc8); loc7.addEventListener(flash.events.Event.COMPLETE, this.variablesSent); } else { this._emailArea.textArea.text = "Email is not valid"; } return; } [ DarkSeID.Always @ 28.10.2011. 15:46 ] @
MenOfHonor, zamolio bi te da mi postavis tvoj mail da bi te kontaktirao.U pitanju je jedan poslic koji ce ti biti placen.
Potreban mi je neko ko dobro radi u Flashu. [ ivanpro @ 28.10.2011. 20:44 ] @
Ha, lepo je to samo ja ne mogu da editujem swf file ???
[ MenOfHonor @ 28.10.2011. 21:10 ] @
Možeš da dekompajliraš taj swf, kao što sam i ja uradio. Nakon toga dobićeš prazan fla fajl kome je osnovna klasa (document class) "Contact" u kojoj se nalazi kod koji treba da izmeniš. Na početku ove teme napisao si da si preuzeo XML galeriju, pa me interesuje da li si uopšte dobio neke fajlove uz njega osim swf i xml fajla? Možda je taj templejt neko ripovao sa nekog sajta pa zato nema svih potrebnih fajlova.
[ ivanpro @ 28.10.2011. 21:29 ] @
U tome i jeste problem, imam samo swf i xml fajlove.
Hvala ti na trudu ![]() [ ivanpro @ 28.10.2011. 21:34 ] @
Uspeo sam da dekompajliram i dobio contact.as
Sada mi nije jasno gde da dodam onaj code koji si mi napisao malopre? Da li je ceo code nov ili samo treba da dodam neku liniju, jer ja ne vidim takav code samo imam ovo : package { import caurina.transitions.*; import caurina.transitions.properties.*; import flash.display.*; import flash.events.*; import flash.filters.*; import flash.geom.*; import flash.net.*; import flash.text.*; public class Contact extends Sprite { private var _xml:XML; private var _settings:XMLList; private var _css:StyleSheet; private var _background:Sprite; private var _nameArea:TextInputArea; private var _emailArea:TextInputArea; private var _subjectArea:TextInputArea; private var _messageArea:TextInputArea; private var _pageTitle:pageTitle; private var _sendBtn:SendButton; private var _bgColor:ColorTransform; private var _lineColor:ColorTransform; private var _sendBgColor:ColorTransform; private var _sendLineColor:ColorTransform; private var _origTextColor:int; private var _name:String = "Type your name"; private var _email:String = "Type your email"; private var _subject:String = "Type your subject"; private var _message:String = "Type your message"; private var _otherInfo:TextField; public function Contact() { if (stage) { this.init(); } else { addEventListener(Event.ADDED_TO_STAGE, this.init); }// end else if addEventListener(Event.REMOVED_FROM_STAGE, this.removedFromStage); return; } public override function get height() : Number { return this._background.height; } public override function get width() : Number { return this._background.width; } private function init(param1:Event = null) : void { ColorShortcuts.init(); var _loc_2:* = new URLLoader(); _loc_2.load(new URLRequest(GlobalVar.xmlAddress)); _loc_2.addEventListener(Event.COMPLETE, this.xmlLoaded); return; } private function xmlLoaded(param1:Event) : void { this._xml = XML(param1.target.data); this._settings = this._xml.child("settings"); var _loc_2:* = new URLLoader(); _loc_2.load(new URLRequest("style.css")); _loc_2.addEventListener(Event.COMPLETE, this.cssLoaded); return; } private function cssLoaded(param1:Event) : void { this._css = new StyleSheet(); this._css.parseCSS(param1.target.data); this.addElements(); return; } private function addElements() : void { this._background = new Sprite(); this._background.graphics.lineStyle(0, this._settings.@backgroundColor, 1, true, "none"); this._background.graphics.beginFill(this._settings.@backgroundColor, this._settings.@backgroundOpacity / 100); this._background.graphics.drawRect(0, 0, this._settings.@backgroundWidth, this._settings.@backgroundHeight); this._background.graphics.endFill(); this.addChild(this._background); this._background.filters = [new DropShadowFilter(1, 90, 0, 1, 5, 5, 0.7, 3)]; this._bgColor = new ColorTransform(); this._bgColor.color = this._settings.@textInputBgColor; this._lineColor = new ColorTransform(); this._lineColor.color = this._settings.@textInputLineColor; this._sendBgColor = new ColorTransform(); this._sendBgColor.color = this._settings.@sendButtonBgColor; this._sendLineColor = new ColorTransform(); this._sendLineColor.color = this._settings.@sendButtonLineColor; this._pageTitle = new pageTitle(); this._pageTitle.titleText.autoSize = TextFieldAutoSize.LEFT; this._pageTitle.titleText.styleSheet = this._css; this._pageTitle.x = this._settings.@textInputPaddingX; this._pageTitle.y = this._settings.@textInputPaddingX; this._pageTitle.titleText.htmlText = this._xml.child("title"); this.addChild(this._pageTitle); this._nameArea = new TextInputArea(); this._nameArea.x = this._settings.@textInputPaddingX; this._nameArea.y = this._settings.@textInputPaddindY; this._nameArea.bgFill.transform.colorTransform = this._bgColor; this._nameArea.bgLine.transform.colorTransform = this._lineColor; this._nameArea.bgFill.width = this._settings.@textInputWidth; this._nameArea.bgFill.height = this._nameArea.textArea.height + 4; this._nameArea.bgFill.alpha = this._settings.@textInputBgOpacity / 100; this._nameArea.bgLine.width = this._nameArea.bgFill.width; this._nameArea.bgLine.height = this._nameArea.bgFill.height; this._nameArea.textArea.width = this._nameArea.bgFill.width--; this._nameArea.textArea.textColor = this._settings.@textInputTextColor; this._nameArea.textArea.maxChars = this._settings.@nameAreaMaxChars; this._nameArea.textArea.text = this._name; this._nameArea.textArea.addEventListener(FocusEvent.FOCUS_IN, this.onFocus); this.addChild(this._nameArea); this._emailArea = new TextInputArea(); this._emailArea.x = this._settings.@textInputPaddingX; this._emailArea.y = this._nameArea.y + this._nameArea.height + Number(this._settings.@textInputVerticalSpace); this._emailArea.bgFill.transform.colorTransform = this._bgColor; this._emailArea.bgLine.transform.colorTransform = this._lineColor; this._emailArea.bgFill.width = this._settings.@textInputWidth; this._emailArea.bgFill.height = this._emailArea.textArea.height + 4; this._emailArea.bgFill.alpha = this._settings.@textInputBgOpacity / 100; this._emailArea.bgLine.width = this._emailArea.bgFill.width; this._emailArea.bgLine.height = this._emailArea.bgFill.height; this._emailArea.textArea.width = this._emailArea.bgFill.width--; this._emailArea.textArea.textColor = this._settings.@textInputTextColor; this._emailArea.textArea.maxChars = this._settings.@emailAreaMaxChars; this._emailArea.textArea.text = this._email; this._emailArea.textArea.addEventListener(FocusEvent.FOCUS_IN, this.onFocus); this.addChild(this._emailArea); this._subjectArea = new TextInputArea(); this._subjectArea.x = this._settings.@textInputPaddingX; this._subjectArea.y = this._emailArea.y + this._emailArea.height + Number(this._settings.@textInputVerticalSpace); this._subjectArea.bgFill.transform.colorTransform = this._bgColor; this._subjectArea.bgLine.transform.colorTransform = this._lineColor; this._subjectArea.bgFill.width = this._settings.@textInputWidth; this._subjectArea.bgFill.height = this._emailArea.textArea.height + 4; this._subjectArea.bgFill.alpha = this._settings.@textInputBgOpacity / 100; this._subjectArea.bgLine.width = this._emailArea.bgFill.width; this._subjectArea.bgLine.height = this._emailArea.bgFill.height; this._subjectArea.textArea.width = this._emailArea.bgFill.width--; this._subjectArea.textArea.textColor = this._settings.@textInputTextColor; this._subjectArea.textArea.maxChars = this._settings.@subjectAreaMaxChars; this._subjectArea.textArea.text = this._subject; this._subjectArea.textArea.addEventListener(FocusEvent.FOCUS_IN, this.onFocus); this.addChild(this._subjectArea); this._messageArea = new TextInputArea(); this._messageArea.x = this._settings.@textInputPaddingX; this._messageArea.y = this._subjectArea.y + this._subjectArea.height + Number(this._settings.@textInputVerticalSpace); this._messageArea.bgFill.transform.colorTransform = this._bgColor; this._messageArea.bgLine.transform.colorTransform = this._lineColor; this._messageArea.bgFill.width = this._settings.@textInputWidth; this._messageArea.bgFill.height = Number(this._settings.@messageAreaHeight) + 4; this._messageArea.bgFill.alpha = this._settings.@textInputBgOpacity / 100; this._messageArea.bgLine.width = this._messageArea.bgFill.width; this._messageArea.bgLine.height = this._messageArea.bgFill.height; this._messageArea.textArea.width = this._messageArea.bgFill.width--; this._messageArea.textArea.height = this._settings.@messageAreaHeight; this._messageArea.textArea.textColor = this._settings.@textInputTextColor; this._messageArea.textArea.maxChars = this._settings.@messageAreaMaxChars; this._messageArea.textArea.text = this._message; this._messageArea.textArea.addEventListener(FocusEvent.FOCUS_IN, this.onFocus); this.addChild(this._messageArea); this._sendBtn = new SendButton(); this._sendBtn.bgFill.width = this._settings.@sendButtonWidth; this._sendBtn.bgFill.height = this._settings.@sendButtonHeight; this._sendBtn.bgLine.width = this._sendBtn.bgFill.width; this._sendBtn.bgLine.height = this._sendBtn.bgFill.height; this._sendBtn.bgFill.transform.colorTransform = this._sendBgColor; this._sendBtn.bgFill.alpha = this._settings.@sendButtonBgOpacity / 100; this._sendBtn.bgLine.transform.colorTransform = this._sendLineColor; this._sendBtn.btnName.embedFonts = true; this._sendBtn.btnName.autoSize = TextFieldAutoSize.LEFT; this._sendBtn.btnName.wordWrap = false; this._sendBtn.btnName.antiAliasType = AntiAliasType.ADVANCED; this._sendBtn.btnName.styleSheet = this._css; this._sendBtn.btnName.htmlText = this._xml.child("sendButtonText"); this._origTextColor = this._sendBtn.btnName.textColor; this._sendBtn.btnName.x = this._sendBtn.bgFill.width / 2 - this._sendBtn.btnName.width / 2; this._sendBtn.btnName.y = this._sendBtn.bgFill.height / 2 - this._sendBtn.btnName.height / 2; this._sendBtn.y = this._messageArea.y + this._messageArea.height + Number(this._settings.@textInputVerticalSpace); this._sendBtn.x = this._messageArea.x + this._messageArea.width - this._sendBtn.width; this._sendBtn.mouseChildren = false; this._sendBtn.buttonMode = true; this._sendBtn.addEventListener(MouseEvent.MOUSE_OVER, this.onMouseOver); this._sendBtn.addEventListener(MouseEvent.MOUSE_OUT, this.onMouseOut); this._sendBtn.addEventListener(MouseEvent.CLICK, this.sendMessage); this.addChild(this._sendBtn); this._otherInfo = new TextField(); this._otherInfo.selectable = false; this._otherInfo.width = this._background.width - 2 * Number(this._settings.@textInputPaddingX) - Number(this._settings.@textInputWidth) - 20; this._otherInfo.autoSize = TextFieldAutoSize.LEFT; this._otherInfo.wordWrap = true; this._otherInfo.multiline = true; this._otherInfo.embedFonts = true; this._otherInfo.antiAliasType = AntiAliasType.ADVANCED; this._otherInfo.condenseWhite = true; this._otherInfo.styleSheet = this._css; this._otherInfo.htmlText = this._xml.child("otherInfo"); this._otherInfo.x = this._background.width - Number(this._settings.@textInputPaddingX) - this._otherInfo.width; this._otherInfo.y = Number(this._settings.@textInputPaddindY); this.addChild(this._otherInfo); return; } private function onMouseOver(param1:MouseEvent) : void { Tweener.addTween(param1.target.bgFill, {_color:this._settings.@sendButtonBgColorOnMouseOver, alpha:this._settings.@sendButtonBgOpacityOnMouseOver / 100, time:0.4}); Tweener.addTween(param1.target.bgLine, {_color:this._settings.@sendButtonLineColorOnMouseOver, time:0.4}); param1.target.btnName.textColor = this._settings.@sendButtonTextColorOnMouseOver; return; } private function onMouseOut(param1:MouseEvent) : void { Tweener.addTween(param1.target.bgFill, {_color:this._settings.@sendButtonBgColor, alpha:this._settings.@sendButtonBgOpacity / 100, time:0.4}); Tweener.addTween(param1.target.bgLine, {_color:this._settings.@sendButtonLineColor, time:0.4}); param1.target.btnName.textColor = this._origTextColor; return; } private function sendMessage(param1:MouseEvent) : void { var _loc_8:URLLoader; var _loc_9:URLRequest; var _loc_10:URLVariables; var _loc_2:* = this._nameArea.textArea.text; var _loc_3:* = this._emailArea.textArea.text; var _loc_4:* = this._subjectArea.textArea.text; var _loc_5:* = this._messageArea.textArea.text; var _loc_6:* = this._xml.child("companyEmail"); var _loc_7:* = this._xml.child("siteName"); if (this.validateEmail(_loc_3)) { _loc_8 = new URLLoader(); _loc_9 = new URLRequest(this._xml.child("phpFile").@src); _loc_10 = new URLVariables(); _loc_8.dataFormat = URLLoaderDataFormat.VARIABLES; _loc_9.method = URLRequestMethod.POST; _loc_10.senderName = _loc_2; _loc_10.senderEmail = _loc_3; _loc_10.senderSubject = _loc_4; _loc_10.senderMessage = _loc_5; _loc_10.companyEmail = _loc_6; _loc_10.siteName = _loc_7; _loc_9.data = _loc_10; _loc_8.load(_loc_9); _loc_8.addEventListener(Event.COMPLETE, this.variablesSent); } else { this._emailArea.textArea.text = "Email is not valid"; }// end else if return; } private function variablesSent(param1:Event) : void { param1.target.removeEventListener(Event.COMPLETE, this.variablesSent); this._nameArea.textArea.text = this._name; Tweener.addTween(this._nameArea.bgFill, {_color:this._settings.@textInputBgColor, alpha:this._settings.@textInputBgOpacity / 100, time:0.4}); Tweener.addTween(this._nameArea.bgLine, {_color:this._settings.@textInputLineColor, time:0.4}); this._nameArea.textArea.textColor = this._settings.@textInputTextColor; this._emailArea.textArea.text = this._email; Tweener.addTween(this._emailArea.bgFill, {_color:this._settings.@textInputBgColor, alpha:this._settings.@textInputBgOpacity / 100, time:0.4}); Tweener.addTween(this._emailArea.bgLine, {_color:this._settings.@textInputLineColor, time:0.4}); this._emailArea.textArea.textColor = this._settings.@textInputTextColor; this._subjectArea.textArea.text = this._subject; Tweener.addTween(this._subjectArea.bgFill, {_color:this._settings.@textInputBgColor, alpha:this._settings.@textInputBgOpacity / 100, time:0.4}); Tweener.addTween(this._subjectArea.bgLine, {_color:this._settings.@textInputLineColor, time:0.4}); this._subjectArea.textArea.textColor = this._settings.@textInputTextColor; this._messageArea.textArea.text = this._message; Tweener.addTween(this._messageArea.bgFill, {_color:this._settings.@textInputBgColor, alpha:this._settings.@textInputBgOpacity / 100, time:0.4}); Tweener.addTween(this._messageArea.bgLine, {_color:this._settings.@textInputLineColor, time:0.4}); this._messageArea.textArea.textColor = this._settings.@textInputTextColor; stage.focus = null; return; } private function onFocus(param1:FocusEvent) : void { this.setName(); if (param1.target.text == this._name) { this._nameArea.textArea.text = ""; Tweener.addTween(this._nameArea.bgFill, {_color:this._settings.@textInputBgColorOnFocus, alpha:this._settings.@textInputBgOpacityOnFocus / 100, time:0.4}); Tweener.addTween(this._nameArea.bgLine, {_color:this._settings.@textInputLineColorOnFocus, time:0.4}); this._nameArea.textArea.textColor = this._settings.@textInputTextColorOnFocus; }// end if if (param1.target.text == this._email || param1.target.text == "Email is not valid") { this._emailArea.textArea.text = ""; Tweener.addTween(this._emailArea.bgFill, {_color:this._settings.@textInputBgColorOnFocus, alpha:this._settings.@textInputBgOpacityOnFocus / 100, time:0.4}); Tweener.addTween(this._emailArea.bgLine, {_color:this._settings.@textInputLineColorOnFocus, time:0.4}); this._emailArea.textArea.textColor = this._settings.@textInputTextColorOnFocus; }// end if if (param1.target.text == this._subject) { this._subjectArea.textArea.text = ""; Tweener.addTween(this._subjectArea.bgFill, {_color:this._settings.@textInputBgColorOnFocus, alpha:this._settings.@textInputBgOpacityOnFocus / 100, time:0.4}); Tweener.addTween(this._subjectArea.bgLine, {_color:this._settings.@textInputLineColorOnFocus, time:0.4}); this._subjectArea.textArea.textColor = this._settings.@textInputTextColorOnFocus; }// end if if (param1.target.text == this._message) { this._messageArea.textArea.text = ""; Tweener.addTween(this._messageArea.bgFill, {_color:this._settings.@textInputBgColorOnFocus, alpha:this._settings.@textInputBgOpacityOnFocus / 100, time:0.4}); Tweener.addTween(this._messageArea.bgLine, {_color:this._settings.@textInputLineColorOnFocus, time:0.4}); this._messageArea.textArea.textColor = this._settings.@textInputTextColorOnFocus; }// end if return; } private function setName() : void { if (this._nameArea.textArea.text == "") { this._nameArea.textArea.text = this._name; Tweener.addTween(this._nameArea.bgFill, {_color:this._settings.@textInputBgColor, alpha:this._settings.@textInputBgOpacity / 100, time:0.4}); Tweener.addTween(this._nameArea.bgLine, {_color:this._settings.@textInputLineColor, time:0.4}); this._nameArea.textArea.textColor = this._settings.@textInputTextColor; }// end if if (this._emailArea.textArea.text == "") { this._emailArea.textArea.text = this._email; Tweener.addTween(this._emailArea.bgFill, {_color:this._settings.@textInputBgColor, alpha:this._settings.@textInputBgOpacity / 100, time:0.4}); Tweener.addTween(this._emailArea.bgLine, {_color:this._settings.@textInputLineColor, time:0.4}); this._emailArea.textArea.textColor = this._settings.@textInputTextColor; }// end if if (this._subjectArea.textArea.text == "") { this._subjectArea.textArea.text = this._subject; Tweener.addTween(this._subjectArea.bgFill, {_color:this._settings.@textInputBgColor, alpha:this._settings.@textInputBgOpacity / 100, time:0.4}); Tweener.addTween(this._subjectArea.bgLine, {_color:this._settings.@textInputLineColor, time:0.4}); this._subjectArea.textArea.textColor = this._settings.@textInputTextColor; }// end if if (this._messageArea.textArea.text == "") { this._messageArea.textArea.text = this._message; Tweener.addTween(this._messageArea.bgFill, {_color:this._settings.@textInputBgColor, alpha:this._settings.@textInputBgOpacity / 100, time:0.4}); Tweener.addTween(this._messageArea.bgLine, {_color:this._settings.@textInputLineColor, time:0.4}); this._messageArea.textArea.textColor = this._settings.@textInputTextColor; }// end if return; } private function validateEmail(param1:String) : Boolean { if (param1.length >= 10) { if (param1.indexOf("@") > 1) { if (param1.indexOf("@") + 2 < param1.indexOf(".")) { if (param1.lastIndexOf(".") < param1.length - 2) { return true; }// end if }// end if }// end if }// end if return false; } private function removedFromStage(param1:Event = null) : void { removeEventListener(Event.REMOVED_FROM_STAGE, this.removedFromStage); this._sendBtn.removeEventListener(MouseEvent.MOUSE_OVER, this.onMouseOver); this._sendBtn.removeEventListener(MouseEvent.MOUSE_OUT, this.onMouseOut); this._sendBtn.removeEventListener(MouseEvent.CLICK, this.sendMessage); this._nameArea.textArea.removeEventListener(FocusEvent.FOCUS_IN, this.onFocus); this._emailArea.textArea.removeEventListener(FocusEvent.FOCUS_IN, this.onFocus); this._subjectArea.textArea.removeEventListener(FocusEvent.FOCUS_IN, this.onFocus); this._messageArea.textArea.removeEventListener(FocusEvent.FOCUS_IN, this.onFocus); while (_loc_2-- >= 1) { // label removeChildAt(this.numChildren--); } removeChildAt(0); return; } } } [ MenOfHonor @ 28.10.2011. 21:50 ] @
Vidi se lepo.
![]() [ ivanpro @ 28.10.2011. 21:55 ] @
Gde se vidi, onda sam ja corav :)
Ti si mi ovo postavio: private function sendMessage(arg1:flash.events.MouseEvent):void { var loc7:*; loc7 = null; var loc8:*; loc8 = null; var loc9:*; loc9 = null; var loc1:*; loc1 = this._nameArea.textArea.text; var loc2:*; loc2 = this._emailArea.textArea.text; var loc3:*; loc3 = this._subjectArea.textArea.text; var loc4:*; loc4 = this._messageArea.textArea.text; var loc5:*; loc5 = this._xml.child("companyEmail"); var loc6:*; loc6 = this._xml.child("siteName"); if (this.validateEmail(loc2)) { loc7 = new flash.net.URLLoader(); loc8 = new flash.net.URLRequest(this._xml.child("phpFile").src); loc9 = new flash.net.URLVariables(); loc7.dataFormat = flash.net.URLLoaderDataFormat.VARIABLES; loc8.method = flash.net.URLRequestMethod.POST; loc9.senderName = loc1; loc9.senderEmail = loc2; loc9.senderSubject = loc3; loc9.senderMessage = loc4; loc9.companyEmail = loc5; loc9.siteName = loc6; loc8.data = loc9; sendToURL(loc8) loc7.load(loc8); loc7.addEventListener(flash.events.Event.COMPLETE, this.variablesSent); } else { this._emailArea.textArea.text = "Email is not valid"; } return; } A ja vidim ovo : private function sendMessage(param1:MouseEvent) : void { var _loc_8:URLLoader; var _loc_9:URLRequest; var _loc_10:URLVariables; var _loc_2:* = this._nameArea.textArea.text; var _loc_3:* = this._emailArea.textArea.text; var _loc_4:* = this._subjectArea.textArea.text; var _loc_5:* = this._messageArea.textArea.text; var _loc_6:* = this._xml.child("companyEmail"); var _loc_7:* = this._xml.child("siteName"); if (this.validateEmail(_loc_3)) { _loc_8 = new URLLoader(); _loc_9 = new URLRequest(this._xml.child("phpFile").@src); _loc_10 = new URLVariables(); _loc_8.dataFormat = URLLoaderDataFormat.VARIABLES; _loc_9.method = URLRequestMethod.POST; _loc_10.senderName = _loc_2; _loc_10.senderEmail = _loc_3; _loc_10.senderSubject = _loc_4; _loc_10.senderMessage = _loc_5; _loc_10.companyEmail = _loc_6; _loc_10.siteName = _loc_7; _loc_9.data = _loc_10; _loc_8.load(_loc_9); _loc_8.addEventListener(Event.COMPLETE, this.variablesSent); } else { this._emailArea.textArea.text = "Email is not valid"; }// end else if return; } Probao sam i sa drugom gde imam fla fajl, ali kada zamenim sa ovom nece da radi ??? Glupo je da te pitam, da li bi ti promenio i spakovao u swf, mada bih vise voleo da mi objasnis kako se to radi. MOze skype ili nesto drugo ... :) [Ovu poruku je menjao ivanpro dana 28.10.2011. u 23:13 GMT+1] [ MenOfHonor @ 28.10.2011. 22:13 ] @
Citat: ivanpro: Gde se vidi, onda sam ja corav ![]() Samo pronađi metod sendMessage. Citat: ivanpro: Glupo je da te pitam, da li bi ti promenio i spakovao u swf, mada bih vise voleo da mi objasnis kako se to radi. E da je sve tako jednostavno... ![]() Code: loc1.load(new flash.net.URLRequest(GlobalVar.xmlAddress)); U klasi GlobalVar nalazi se promenljiva xmlAddress koja nije inicijalizovana, tako da se postavlja pitanje šta je autor uopšte želeo da učita. [ ivanpro @ 28.10.2011. 22:18 ] @
Znaci ipak je najbolje da batalim ovo ???
Da izbacim formu i uradim obican text kontakt (mailto: ............ ) Reci mi zasto (ako znas iz ovog sto si video) nece da prihvati drugu kontakt formu? [Ovu poruku je menjao ivanpro dana 29.10.2011. u 00:00 GMT+1] [ MenOfHonor @ 29.10.2011. 13:45 ] @
Citat: ivanpro: Znaci ipak je najbolje da batalim ovo ??? Da izbacim formu i uradim obican text kontakt (mailto: ............ ) Reci mi zasto (ako znas iz ovog sto si video) nece da prihvati drugu kontakt formu? Zato što je i ovaj originalni bagovit i neće ni on da funkcioniše kako bi trebalo. Evo kako možeš jednostavno, a opet lepo, da odradiš kontakt formu: napravi 4 dinamičkih tekst polja - za ime, email, naslov poruke i poruka koje imaju nazive instanci "ime_txt", "email_txt", "naslovPoruke_txt" i "poruka_txt", respektivno. Dodaj i jedan taster za slanje podataka (submit) sa nazivom instance "posalji_btn". Unesi sledeći kod: Code: // kreiraj URLVariables objekat koji sluzi za definisanje promenljivih koje zelis da posaljes php-u var promenljive:URLVariables = new URLVariables(); // definisanje URL-a php fajla kome saljemo podatke var email:URLRequest = new URLRequest("email.php"); posalji_btn.addEventListener(MouseEvent.CLICK, slanjePodataka); function slanjePodataka(event:Event):void { // definisanje promenljivih koje saljes php-u koje ce imati vrednosti koje su unete u tekstualna polja promenljive.korisnickoIme = ime_txt.text; promenljive.korisnikovEmail = email_txt.text; promenljive.naslovPoruke = "naslovPoruke_txt.text"; promenljive.poruka = "poruka_txt.text"; // dodaj promenljive koje treba da prosledis php-u email.data = promenljive; // navedi POST metod za slanje email.method = URLRequestMethod.POST; // slanje podataka php-u sendToURL(email); } "email.php" treba da izgleda ovako: Code: <?php $ime = $_POST["korisnickoIme"]; $email = $_POST["korisnikovEmail"]; $naslovPoruke = $_POST["naslovPoruke"]; $zaglavlje = "From: " . $ime . "<" . $email .">\r\n"; $zaglavlje .= "Reply-To: " . $email . "\r\n"; $zaglavlje .= "Return-path: " . $email; $poruka = $_POST["poruka"]; mail($email, $naslovPoruke, $poruka, $zaglavlje); ?> Da bi testirao formu moraš da je postaviš na server. Takođe je moguće da ubaciš još jednu polje gde ćeš ispisivati status (na primer: poruka je poslata), a možeš i da proveravaš da li su sva polja ispunjena pre nego što se pošalju. [Ovu poruku je menjao MenOfHonor dana 29.10.2011. u 15:45 GMT+1] [ MenOfHonor @ 29.10.2011. 15:02 ] @
Citat: ivanpro:Reci mi zasto (ako znas iz ovog sto si video) nece da prihvati drugu kontakt formu? Zato što je i ovaj originalni bagovit i neće ni on da funkcioniše kako bi trebalo. Evo kako možeš jednostavno, a opet lepo, da odradiš kontakt formu: napravi 4 dinamičkih tekst polja - za ime, email, naslov poruke i poruku, koje imaju nazive instanci "ime_txt", "email_txt", "naslovPoruke_txt" i "poruka_txt", respektivno. Dodaj i jedan taster za slanje podataka (submit) sa nazivom instance "posalji_btn". Unesi sledeći kod: Code: // kreiraj URLVariables objekat koji sluzi za definisanje promenljivih koje zelis da posaljes php-u var promenljive:URLVariables = new URLVariables(); // definisanje URL-a php fajla kome saljemo podatke var email:URLRequest = new URLRequest("email.php"); posalji_btn.addEventListener(MouseEvent.CLICK, slanjePodataka); function slanjePodataka(event:Event):void { // definisanje promenljivih koje saljes php-u koje ce imati vrednosti koje su unete u tekstualna polja promenljive.korisnickoIme = ime_txt.text; promenljive.korisnikovEmail = email_txt.text; promenljive.primalac = "OVDE UNESI SVOJ EMAIL"; promenljive.naslovPoruke = "naslovPoruke_txt.text"; promenljive.poruka = "poruka_txt.text"; // dodaj promenljive koje treba da prosledis php-u email.data = promenljive; // navedi POST metod za slanje email.method = URLRequestMethod.POST; // slanje podataka php-u sendToURL(email); } "email.php" treba da izgleda ovako: Code: <?php $ime = $_POST["korisnickoIme"]; $email = $_POST["korisnikovEmail"]; $primalac = $_POST["primalac"]; $naslovPoruke = $_POST["naslovPoruke"]; $zaglavlje = "From: " . $ime . "<" . $email .">\r\n"; $zaglavlje .= "Reply-To: " . $email . "\r\n"; $zaglavlje .= "Return-path: " . $email; $poruka = $_POST["poruka"]; mail($primalac, $naslovPoruke, $poruka, $zaglavlje); ?> Da bi mogao da testiraš formu moraš a je postaviš na server. [ MenOfHonor @ 29.10.2011. 15:07 ] @
Citat: ivanpro: Znaci ipak je najbolje da batalim ovo ??? Da izbacim formu i uradim obican text kontakt (mailto: ............ ) Reci mi zasto (ako znas iz ovog sto si video) nece da prihvati drugu kontakt formu? Zato što je i ovaj originalni bagovit i neće ni on da funkcioniše kako bi trebalo. Evo kako možeš jednostavno, a opet lepo, da odradiš kontakt formu: napravi 4 dinamičkih tekst polja - za ime, email, naslov poruke i poruka koje imaju nazive instanci "ime_txt", "email_txt", "naslovPoruke_txt" i "poruka_txt", respektivno. Dodaj i jedan taster za slanje podataka (submit) sa nazivom instance "posalji_btn". Unesi sledeći kod: Code: // kreiraj URLVariables objekat koji sluzi za definisanje promenljivih koje zelis da posaljes php-u var promenljive:URLVariables = new URLVariables(); // definisanje URL-a php fajla kome saljemo podatke var email:URLRequest = new URLRequest("email.php"); posalji_btn.addEventListener(MouseEvent.CLICK, slanjePodataka); function slanjePodataka(event:Event):void { // definisanje promenljivih koje saljes php-u koje ce imati vrednosti koje su unete u tekstualna polja promenljive.korisnickoIme = ime_txt.text; promenljive.korisnikovEmail = email_txt.text; promenljive.primalac = "OVDE UNESI SVOJ EMAIL"; promenljive.naslovPoruke = "naslovPoruke_txt.text"; promenljive.poruka = "poruka_txt.text"; // dodaj promenljive koje treba da prosledis php-u email.data = promenljive; // navedi POST metod za slanje email.method = URLRequestMethod.POST; // slanje podataka php-u sendToURL(email); } "email.php" treba da izgleda ovako: Code: <?php define("PRIMALAC", "[email protected]"); $ime = $_POST["korisnickoIme"]; $email = $_POST["korisnikovEmail"]; $naslovPoruke = $_POST["naslovPoruke"]; $zaglavlje = "From: " . $ime . "<" . $email .">\r\n"; $zaglavlje .= "Reply-To: " . $email . "\r\n"; $zaglavlje .= "Return-path: " . $email; $poruka = $_POST["poruka"]; mail(PRIMALAC, $naslovPoruke, $poruka, $zaglavlje); ?> Sada možeš da testiraš formu na svom računaru korišćenjem wamp servera. [ ivanpro @ 01.11.2011. 19:49 ] @
Hvala ti na vremenu i trudu, ali meni nesto ovde ne ide ????
Imam problem prilikom dekompajliranja swf-a. Korisitim Sothink SWF Decompiler 4.0, i kada ubacim contact.swf, ja imam samo sivu pozadinu, ne vidim nikakav video ? Kada to exportujem u fla i otvorim u Adobe Flash-u opet je samo siva pozadina i nista vise ne mogu da promenim. ??? Reci mi gde gresim? Da li je ovaj dekomp. ok ili mi treba nesto drugo? Da li si ti uspeo da dekomp. i da li mozes da editujes ? PS. nisam ekspert u radu sa flash-om :) [ MenOfHonor @ 02.11.2011. 01:24 ] @
Uspešno sam dekompajlirao taj projekat, ali ni kod mene ne funkcioniše. Prijavljuje grešku baš tamo gde sam ti objasnio u jednom od prethodnih odgovora.
Copyright (C) 2001-2025 by www.elitesecurity.org. All rights reserved.
|