I have a list of text files and when one is selected it is read and assigned to a string variable. this string is then pushed to a view : pushView(viewer, string), where the string is displayed in a textarea. I want to also pass the relative path of the file also. Is this possible to pass two strings?
protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void
{
if(data!=null){
mainTextField.text = data.toString();
}else{
mainTextField.text = "";
}
}
Yes it is possible. Typically the way I do this in Flex is to add a
dataproperty on my view of typeObjectallowing me to pass any type of object into the view.In your case I would change
pushView(viewer, string)to something likepushView(viewer, data)wheredatais some object that stores all the data you need to pass to the view.datamight look like: