header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
nannu
Points:0
Posts:0

5/10/2010 9:57:06 PM

Title: how to access private variables in flex




<mx:Script>
		<![CDATA[
private function myEventHandler(event:MouseEvent):void {
	      	var obj:Object = ((event.currentTarget).getRepeaterItem().@mediahubfile);
}  
	    ]]>
<mx:VideoDisplay id="vid" source="obj"  autoPlay="true" width="400" height="300" />

hi ,i am new to programming world
i want to pass reference of obj to video display as source

plzzz help



1
amar
Points: 0
Posts:0
5/10/2010 10:56:34 PM



you can do it like this -

[Bindable]
private var obj:Object;

<mx:Script>
<![CDATA[
private function myEventHandler(event:MouseEvent):void {

obj = ((event.currentTarget).getRepeaterItem().@mediahubfile);
}
]]>
<mx:VideoDisplay id="vid" source="obj" autoPlay="true" width="400" height="300" />

2
amar
Points: 0
Posts:0
5/10/2010 10:58:35 PM



Sorry I did a mistake in above code,I declared obj variable outside of script tag , just a typo , Do like this -

<mx:Script>
<![CDATA[

[Bindable]
private var obj:Object;

private function myEventHandler(event:MouseEvent):void {

obj = ((event.currentTarget).getRepeaterItem().@mediahubfile);
}
]]>
<mx:VideoDisplay id="vid" source="obj" autoPlay="true" width="400" height="300" />

3
nannu
Points: 0
Posts:0
5/10/2010 11:24:59 PM



Thank u amar.

but still the video is not playing ,should i use play(),if yes where and how to use it.

4
nannu
Points: 0
Posts:0
5/11/2010 2:16:57 AM



thank u amar got it..


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 4+6 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions