Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HTTPService Parse Error

    Hi,

    I'm currently working on a little projec. I'm new to ActionScript and Flex.

    Now I'm using "HTTPService" to send form information to a page written in PHP.

    I'm getting a parsing error on this line:

    Code:
    <mx:HTTPService id="userRequest" url="test.php" useProxy="false" method="POST">
    This the rest of that part:

    Code:
    <mx:request xmlns="">
    <height1>
    {wallpaper_height_feet.text}
    </height1>
    <height2>
    {wallpaper_height_inches.text}
    </height2>
    <width1>
    {wallpaper_width_feet.text}
    </width1>
    <width2>
    {wallpaper_width_inches.text}
    </width2>
    </mx:request>
    </mx:HTTPService>

    If you need anything more, please just say so.

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Could you post the exact error, and a sample of code that generates it?

  • #3
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It just says:

    "Parse error at '<mx:HTTPService>'"

    I think this is all that is relevant:

    Code:
    <mx:HTTPService id="userRequest" url="test.php" useProxy="false" method="POST">
    <mx:request xmlns="">
    <height1>
    {wallpaper_height_feet.text}
    </height1>
    <height2>
    {wallpaper_height_inches.text}
    </height2>
    <width1>
    {wallpaper_width_feet.text}
    </width1>
    <width2>
    {wallpaper_width_inches.text}
    </width2>
    </mx:request>
    </mx:HTTPService>
    
    
    <mx:Form x="0" y="33.35" width="518" height="232.65" defaultButton="{next1}">
    <mx:Text text="Height:" fontSize="11"/>
    <mx:FormItem label="Feet:" fontSize="11" borderColor="#FFFFFF">
    <mx:TextInput width="80" id="wallpaper_height_feet" text="{wallpaperSubmitDimensions.wallpaper_height_feet}"/>
    </mx:FormItem>
    <mx:FormItem label="Inches:" fontSize="11">
    <mx:TextInput width="79" id="wallpaper_height_inches">
    <mx:text>{wallpaperSubmitDimensions.wallpaper_height_inches}</mx:text>
    </mx:TextInput>
    </mx:FormItem>
    <mx:Text text="Width:" fontSize="11"/>
    <mx:FormItem label="Feet:" fontSize="11" borderColor="#FFFFFF">
    <mx:TextInput width="80" id="wallpaper_width_feet" text="{wallpaperSubmitDimensions.wallpaper_width_feet}"/>
    </mx:FormItem>
    <mx:FormItem label="Inches:" fontSize="11">
    <mx:TextInput width="79" id="wallpaper_width_inches">
    <mx:text>{wallpaperSubmitDimensions.wallpaper_width_inches}</mx:text>
    </mx:TextInput>
    </mx:FormItem>
    <mx:FormItem>
    <mx:Button label="Next" fontSize="11" id="next1" click="userRequest.send()"/>
    </mx:FormItem>
    </mx:Form>

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    What is giving you the parse error? That snippet compiles fine for me when I remove the unreferenced bound variables. I never get a syntax error either way.

  • #5
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, this is the whole code:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application 
    	xmlns:mx="http://www.adobe.com/2006/mxml" 
    	layout="absolute" 
    	horizontalAlign="center" 
    	verticalAlign="middle"
    	width="550" 
    	height="350"
    	backgroundGradientColors="[#ffffff,#ffffff]"
    	currentState="Intro"
    	creationComplete="userRequest.Send()" 
    	xmlns="*">
    	
    	<mx:Binding source="wallpaper_height_feet.text" destination="wallpaperSubmitDimensions.wallpaper_height_feet"/>
    	<mx:Binding source="wallpaper_height_inches.text" destination="wallpaperSubmitDimensions.wallpaper_height_inches"/>
    	<mx:Binding source="wallpaper_width_feet.text" destination="wallpaperSubmitDimensions.wallpaper_width_feet"/>
    	<mx:Binding source="wallpaper_width_inches.text" destination="wallpaperSubmitDimensions.wallpaper_width_inches"/>
    	
    	<mx:states>
    		<mx:State name="Product_Choice">
    		
    		<mx:Script>
    			<![CDATA[
    				
    				public function choiceWallpaper():void {
    					currentState = 'Wallpaper'
    				}
    					
    				public function choiceCustom():void {
    					currentState = 'Custom'
    				}
    								
    			]]>
    		</mx:Script>
    		
    			<mx:RemoveChild target="{panel1}"/>
    			<mx:AddChild position="lastChild">
    				<mx:Panel x="0" y="0" width="550" height="350" layout="absolute" title="Create Your Own DormPaper!">
    					<mx:TextArea x="43" y="33" width="444" height="51" borderStyle="none" fontSize="11">
    						<mx:text>So, here we go. Now we need to know if you're going to customize a wallpaper, or if you want to add a personal touch to something such as electronics or other personal items.</mx:text>
    					</mx:TextArea>
    					<mx:Button x="43" y="129" label="Wallpaper" width="195" height="46" cornerRadius="6" fontSize="11" click="choiceWallpaper()"/>
    					<mx:Button x="292" y="129" label="Custom items" width="195" height="46" cornerRadius="6" fontSize="11"/>
    				</mx:Panel>
    			</mx:AddChild>
    		</mx:State>
    		<mx:State name="Intro">
    		
    			<mx:Script>
    				<![CDATA[
    				
    					private function accept():void {
    						currentState = 'Product_Choice'
    					}
    				
    				]]>
    			</mx:Script>
    			
    			<mx:AddChild position="lastChild">
    				<mx:Panel x="0" y="0" width="550" height="350" layout="absolute" title="Create Your Own DormPaper!">
    			</mx:Panel>
    			</mx:AddChild>
    			<mx:AddChild position="lastChild">
    				<mx:TextArea x="47" y="56" width="456" height="240" wordWrap="true" editable="false" enabled="true" fontSize="11" borderStyle="none">
    					<mx:text>Welcome! Here you can upload, edit, and customize your own images and designs for your custom order. Create wallpapers, covers for electronics, and much more. Once you have finished, the design will be sent to our team where they will estimate the cost and you will recieve a personal quote. If you have any question or concerns, please e-mail us at support@dormpaper.com</mx:text>
    				</mx:TextArea>
    			</mx:AddChild>
    			<mx:AddChild position="lastChild">
    				<mx:TextArea x="128" y="234" width="288" fontSize="9" borderColor="#FFFFFF" height="38">
    					<mx:text>By clicking continue, you agree to the Terms of Use, which can be found in a link at the bottom of every page.</mx:text>
    				</mx:TextArea>
    			</mx:AddChild>
    			<mx:AddChild position="lastChild">
    				<mx:Button x="193" y="171" width="158" height="41" label="Continue" fontSize="11" click="accept()"/>
    			</mx:AddChild>
    			<mx:RemoveChild target="{panel1}"/>
    		</mx:State>
    		
    		
    		<mx:State name="Wallpaper">
    		
    			<mx:Script>
    				<![CDATA[
    					
    					import WallpaperSubmitDimensions
    					
    					[Bindable]
    					public var wallpaperSubmitDimensions : WallpaperSubmitDimensions = new WallpaperSubmitDimensions();
    					
    				]]>
    			</mx:Script>
    
    			
    			<mx:AddChild relativeTo="{panel1}" position="lastChild">
    				<mx:TabNavigator x="0" y="0" width="530" height="310">
    					<mx:Canvas label="Dimensions" width="100%" height="100%" id="canvasDimensions">
    						<mx:TextArea x="75.5" y="10" width="378" fontSize="11" borderStyle="none" height="22" editable="false">
    							<mx:text>Ok, now we need the dimensions you want your wallpaper to be.</mx:text>
    						</mx:TextArea>
    						
    						 <mx:HTTPService id="userRequest" url="test.php" useProxy="false" method="POST">
    			  			 <mx:request xmlns="">
    			  			 <height1>
    			  			 	{wallpaper_height_feet.text}
    			  			 </height1>
    			  			 <height2>
    			  			 	{wallpaper_height_inches.text}
    			  			 </height2>
    			  			 <width1>
    			  			 	{wallpaper_width_feet.text}
    			  			 </width1>
    			  			 <width2>
    			  			 	{wallpaper_width_inches.text}
    			  			 </width2>
    			 			 </mx:request>
    			   			 </mx:HTTPService>
    
    						
    						<mx:Form x="0" y="33.35" width="518" height="232.65" defaultButton="{next1}">
    							<mx:Text text="Height:" fontSize="11"/>
    							<mx:FormItem label="Feet:" fontSize="11" borderColor="#FFFFFF">
    								<mx:TextInput width="80" id="wallpaper_height_feet" text="{wallpaperSubmitDimensions.wallpaper_height_feet}"/>
    							</mx:FormItem>
    							<mx:FormItem label="Inches:" fontSize="11">
    								<mx:TextInput width="79" id="wallpaper_height_inches">
    									<mx:text>{wallpaperSubmitDimensions.wallpaper_height_inches}</mx:text>
    								</mx:TextInput>
    							</mx:FormItem>
    							<mx:Text text="Width:" fontSize="11"/>
    							<mx:FormItem label="Feet:" fontSize="11" borderColor="#FFFFFF">
    								<mx:TextInput width="80" id="wallpaper_width_feet" text="{wallpaperSubmitDimensions.wallpaper_width_feet}"/>
    							</mx:FormItem>
    							<mx:FormItem label="Inches:" fontSize="11">
    								<mx:TextInput width="79" id="wallpaper_width_inches">
    									<mx:text>{wallpaperSubmitDimensions.wallpaper_width_inches}</mx:text>
    								</mx:TextInput>
    							</mx:FormItem>
    							<mx:FormItem>
    								<mx:Button label="Next" fontSize="11" id="next1" click="userRequest.send()"/>
    							</mx:FormItem>
    						</mx:Form>
    						
    						
    					</mx:Canvas>
    					<mx:Canvas label="Design" width="100%" height="100%" id="canvasDesign">
    						<mx:Button x="70" y="36" label="Button" click=""/>
    					</mx:Canvas>
    				</mx:TabNavigator>
    			</mx:AddChild>
    		</mx:State>
    		<mx:State name="Custom"/>
    	</mx:states>
    	
    	
    </mx:Application>
    I also just came across another problem. The state, wallpaper, doesn't show up in design view, nor does it show up when I run it. Sorry for any stupid mistakes.

  • #6
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    The HTTPService needs to be outside of the Canvas and State tags. Move it up to where your bindings are. Not sure about your wallpaper issue. I don't have your custom "WallpaperSubmitDimensions" class. You have a couple of things, including the AddChild tag in the Wallpaper state bound to "panel1", which wasn't part of the code you posted.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •