How do i reference a container from inside an object.
if an object is in a container, how does the object
fetch a value stored in the container. do you
have to pass a reference to the container when you
create the object. In Visual Foxpro it is easy, you
this go
value = THIS.PARENT.GetValue().
what is the best way to do this in java?
thanks for any help
owen brandon
I'm not sure what you're getting after -- maybe you could explain your actual setup.
Taking a SWAG:
If you have a textfield within a panel, you just reference the textfield directly. The container is just for visual organization.
If you have a textfield in a different frame, you need to make the textfield public (i.e. no access modifier) or you need to make the textfield private and provide accessor (and maybe a mutator) method for it (i.e. create your own getValue(Object component) method to grab the data.
Similar Messages
-
How do a reference a container from one of its objects?
If i have on object in a container, how do i reference the
container from inside the object. For instance, if i have
a textbox and i want it to change color depending on
a value in the container, how do i get to the container.
thanks for any help
owen brandonIf you are asking about AWT or Swing, the Component class has a getParent() method that returns a Container.
-
How can I update cluster items from inside a while loop that does not contain the cluster?
I have a VI that contains front panel clusters and two while loops. The main cluster contains items such as a doubles "distance" and "stepsize" and boolean "step" (a whole buch of this type stuff). The first loop contains an event structure to detect front panel changes and the second contains code and sub VIs to perform operations based on detected events.
The operator can enter data into either double or click the boolean. If distance is changed the second loop does what is required to process the change. The same happens with stepsize. If step is clicked the ±stepsize value is added to distance and the result is processed. In each case the front panel should track the result of the input and subsequent processing.
Because the clusters are outside the while loop, they are not updated unless I click 'highlight execution' which seems to allow updating each time the execution highlight is updated. There are other issues if I move the clusters into one of the loops.
I've tried referencing the clusters and using local variables and nothing works. It looks like overkill to use shared variables for this.
Any ideas would be greatly appreciated.
Thanks,
FrankHi Ben,
Thank you for the response. I followed the link and tried reading everything you posted on AEs but I'm afraid that I didn't understand it all. It seems that each AE example had a single input and a single output (e.g. a double). Is this the case?
What I have is a couple of front panel clusters containing (approximately) 18 control doubles, 8 indicator doubles, 5 boolean radio button constructs and 26 boolean control discretes. I clusterized it to make it readable. In addition I'll eventually have a cluster of task references for hardware handles.
All I want to do is update the front panel values like I would do in a C, VB or any other language. I've tried referencing the cluster and using the reference from inside the loops. I've tied using local variables. Neither works. I'm experimenting with globals but it seems that I have to construct the front panel in the gloabal and then I wouldn't know how to repoduce that on the front panel of the main VI. Sometimes it seems that more time is spent getting around Labview constructs than benefitting from them.
I hope the 'Add Attachment' function actuals puts a copy of the VI here and not a link to it.
Thanks again for the suggestion,
Frank
Attachments:
Front Panel Reference.vi 33 KB -
How can I permit all traffic from inside-dmz-outside on asa5505
Scenario :
Servers are in DMZ, Internal LAN Users should access ports Specified (5000 & 2048). Router 2801 is facing Leased line; from there it’s connected to firewall.
Router LAN IP: 83.111.X.X - 255.255.255.X
ASA Version 7.2(4)
hostname ciscoasa
domain-name default.domain.invalid
enable password 2KFQnbNIdI.2KYOU encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
interface Vlan1
nameif inside
security-level 100
ip address 192.168.X.X 255.255.255.0
interface Vlan2
nameif outside
security-level 0
ip address 83.111.X.X 255.255.255.240
interface Vlan3
nameif dmz
security-level 100
ip address 192.168.100.1 255.255.255.0
interface Ethernet0/0
switchport access vlan 2
interface Ethernet0/1
interface Ethernet0/2
switchport access vlan 3
interface Ethernet0/3
interface Ethernet0/4
interface Ethernet0/5
interface Ethernet0/6
switchport access vlan 3
interface Ethernet0/7
ftp mode passive
dns server-group DefaultDNS
domain-name default.domain.invalid
same-security-traffic permit inter-interface
same-security-traffic permit intra-interface
pager lines 24
logging asdm informational
mtu inside 1500
mtu outside 1500
mtu dmz 1500
no failover
icmp unreachable rate-limit 1 burst-size 1
asdm image disk0:/asdm-524.bin
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 1 0.0.0.0 0.0.0.0
route outside 0.0.0.0 0.0.0.0 83.111.x.x
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
http server enable
http 192.168.1.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
telnet timeout 5
ssh timeout 5
console timeout 0
dhcpd auto_config outside
dhcpd address 192.168.1.2-192.168.1.254 inside
dhcpd enable inside
class-map inspection_default
match default-inspection-traffic
policy-map type inspect dns preset_dns_map
parameters
message-length maximum 512
policy-map global_policy
class inspection_default
inspect dns preset_dns_map
inspect ftp
inspect h323 h225
inspect h323 ras
inspect rsh
inspect rtsp
inspect esmtp
inspect sqlnet
inspect skinny
inspect sunrpc
inspect xdmcp
inspect sip
inspect netbios
inspect tftp
service-policy global_policy global
prompt hostname context
Cryptochecksum:5663409d6ba3ad0bcd163e691f032f76
: endHi Ben,
Thank you for the response. I followed the link and tried reading everything you posted on AEs but I'm afraid that I didn't understand it all. It seems that each AE example had a single input and a single output (e.g. a double). Is this the case?
What I have is a couple of front panel clusters containing (approximately) 18 control doubles, 8 indicator doubles, 5 boolean radio button constructs and 26 boolean control discretes. I clusterized it to make it readable. In addition I'll eventually have a cluster of task references for hardware handles.
All I want to do is update the front panel values like I would do in a C, VB or any other language. I've tried referencing the cluster and using the reference from inside the loops. I've tied using local variables. Neither works. I'm experimenting with globals but it seems that I have to construct the front panel in the gloabal and then I wouldn't know how to repoduce that on the front panel of the main VI. Sometimes it seems that more time is spent getting around Labview constructs than benefitting from them.
I hope the 'Add Attachment' function actuals puts a copy of the VI here and not a link to it.
Thanks again for the suggestion,
Frank
Attachments:
Front Panel Reference.vi 33 KB -
Can Anyone help to find a way?
http://answers.acrobatusers.com/How-call-Adobe-Reader-inside-application-avoid-operator-op en-save-doc-q13487.aspx
From inside my application that run on an Automation PC, under Windows O.S, I want to call Adobe Reader using a shell command to open up an PDF Document containing some informations.
Shell command like these
"C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe" /A "<options>" "C:\mydoc.pdf"
or
cmd /c "C:\mydoc.pdf"
Operator is using a touchscreen.
I want to prevent user to access any option that can give him acces to filesystem (Open/save/save as).
I want also to prevent any change/add information to PDF document
Thank you in advance for the time you will spend for me.You can use the Installation Tuner for Reader to customize the UI elements provided to the user. Details on the Adobe web site.
-
How do I reference a MovieClip from a class
Hi. Trying to learn AS3 and having a hard time ; (
I'm working on a game. I have a Ship class that uses addChild
to add a linked Bullet MovieClip to the stage. The Bullet MC is
linked to the class below. I've got it working so it moves up the
screen, but now I need to build a hitTest, however I cant get
access to a movie clip I've placed on the stage, "enemyDisplay_mc".
How do I reference this MC? In AS2 I would just do a _root.
Thanks!
package {
import flash.display.*;
import flash.events.Event;
public class Weapons extends MovieClip {
private var _thisWeaponMC:MovieClip;
private var _enemyHit:DisplayObject;
private var _speed:Number;
public function Weapons () {
this.addEventListener (Event.ADDED,Initialize);
private function Initialize (event:Event):void {
//trace ("Weapons");
_thisWeaponMC =
MovieClip(this.parent.getChildByName(this.name));
trace ("_thisWeaponMC: " + _thisWeaponMC);
_thisParent = event.currentTarget.parent;
trace ("_thisParent: " + _thisParent);
_enemyHit = this.parent.getChildByName("enemyDisplay_mc");
trace ("_enemyHit: " + _enemyHit);
_speed=20;
this.addEventListener (Event.ENTER_FRAME,moveShip);
private function moveShip (event:Event):void {
this.y-= _speed;
}This code is called from my Ship class.
The Ship class is the Base class of the ship movie clip.
VulcanShot is the linkage class name of the bullet movie,
it's base class is Weapons.
Thanks! -
If you login to an SAP session and then create another session via the system menu option (not a second login), transaction SM04 will show two different values for the parameter:
modeinfo[n].context_id_uuid
I need to know how to retrieve the value of this parameter from inside an ABAP program.
This question is related to the one Rich and Naren and I were discussing - about how to create a unique shared buffer memory id that will distinugish between a two sesssions of a single user who happens to be "MIGO'ng" twice.
Thanks for whatever answer anyone can provide ...
djh
Note: also posted in ABAP General ...Rich answered in ABAP general:
REPORT ZRICH_0001 .
type-pools: thfb.
data: context_id type THFB_CONTEXT_ID.
CALL FUNCTION 'TH_GET_CONTEXT_ID'
IMPORTING
CONTEXT_ID = context_id .
write:/ context_id . -
How to use the google search from inside a java program
Hi guys
How can i use google search in my java program?
What will be the type of the reply i get back from google?
Thanks in advance
[http://javamilestone.blogspot.com/|http://javamilestone.blogspot.com/]Hi,
You have here some examples about how to make search on google from a Java application.
The type of reply is JSON
Here some documentation about it:
[http://code.google.com/apis/ajaxsearch/documentation/#fonje|http://code.google.com/apis/ajaxsearch/documentation/#fonje]
And here some snippets:
[http://code.google.com/apis/ajaxsearch/documentation/#fonje_snippets|http://code.google.com/apis/ajaxsearch/documentation/#fonje_snippets]
Regards,
David. -
How to execute linux sh command from inside CF
I am using CFMX 7,0,0,91690 Enterprise on Redhat Enterprise Linux 4.9 with Apache webserver 2.0.52. I have a coldfusion template that queries from a Postgresql 8.0 database, copies the data from the queries into a set of files in one folder on the linux server, and then has a CFEXECUTE tag at the very end that calls a bash shell script on the same server. The shell script takes the files from the one folder, merges some of their content together, moves them to another folder, adds header and footer, and sets ownership and permissions. These 2 scripts have been in place and working perfectly for several years now. No changes were made to content, permissions, or ownershop of scripts. Suddenly last Friday the coldfusion script seems to have lost its ability to execute the shell script properly. It does execute it and the shell script attempts to do some of the steps, but the resulting files are missing the content and have the linux environmental variables and their values displayed instead. Clearly its getting an error but that is not being reported back to me. After the CF script ends, if I manually execute the shell script from the linux command line, it works perfectly. I tried giving it more permissions but that did not help. Redhat support suggests I run the script with "sh -x" to get more detailed output for debugging, but I would need to do that from inside the CF script since that is where the problem is. Is it possible to execute a shell script from inside a CF script using a linux "sh" command in some way (instead of the cfexecute, just so I can see debugging info)? Thanks in advance for any suggestions. Julie
Thanks for the suggestion, tried that too:
<cfexecute name="/bin/sh" arguments="-x /bin/siscopy" outputfile="/home/coldfusion/sh_output.txt" timeout="600" />
still didn't work. Script ends with this coldfusion error: Timeout period expired without completion of /bin/sh
It does not complete the task of making the files, and the sh_output.txt file which is supposed to capture the -x output, is empty.
Thanks,
Julie -
How to copy/access a string from inside the driver
is there any equivalent to strncpy() to use inside
the driver for copying user sent data to local buffer .
i used I_STRioctl and assigned struct to strioctl.ic_dp
as shown below..
char * buf;
struct user-data
int minor;
char* data;
struct user_data u_data;
buf="hello world"
u_data.minor=0;
u_data.data=buf;
strioctl.ic_dp=&u_data;
strioctl.ic_len=sizeof(struct user_data);
ioctl(fd,I_STR,&strioctl);
when i tried to copy/access the string sent by the user application from inside the driver, machine gets into
booting ...
here what i did was
in wput routine
struct user_data *u_data;
u_data =(struct user_data*)mp->b_cont->b_rptr;
cmn_err(CE_NOTE,"minor= %d",u_data->minor);
till here working well..
where as..
cmn_err(CE_NOTE,"data= %s",u_data->data);
causing panic to the system...booting happens.
please help me out ..
thank u all
ss vasulooks like the data pointed to by 'data' is not copied from user space to kernel space.
u_data.data=buf, just makes pointer assignment, does not copy data pointed to by buf.
two solutions:
1. Declare data as a array(char data[10] or something
2. Copy buf after the structure and point data to it. strioctl.ic_len should be set to sizeof(struct) +
data size.
-Vijay
is there any equivalent to strncpy() to use inside
the driver for copying user sent data to local buffer
i used I_STRioctl and assigned struct to
strioctl.ic_dp
as shown below..
char * buf;
struct user-data
int minor;
char* data;
struct user_data u_data;
buf="hello world"
u_data.minor=0;
u_data.data=buf;
strioctl.ic_dp=&u_data;
strioctl.ic_len=sizeof(struct user_data);
ioctl(fd,I_STR,&strioctl);
when i tried to copy/access the string sent by the
user application from inside the driver, machine gets
into
booting ...
here what i did was
in wput routine
struct user_data *u_data;
u_data =(struct user_data*)mp->b_cont->b_rptr;
r;
cmn_err(CE_NOTE,"minor= %d",u_data->minor);
till here working well..
where as..
cmn_err(CE_NOTE,"data= %s",u_data->data);
causing panic to the system...booting happens.
please help me out ..
thank u all
ss vasu -
How to put the text "BottomCENTER" from inside JLabel1 out of Jlabel1??
Dear friends:
I have following code,
It can run.
I hope to move the text "BottomCENTER" from inside JLabel1 out of Jlabel1,
I mean Text "BottomCENTER" should be display outside of JLabel1
import java.awt.Color;
import java.awt.GridLayout;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
public class AlignmentExample {
public static void main(String[] args) {
// Create the labels and set alignment
JLabel label1 = new JLabel("BottomCENTER", SwingConstants.CENTER);
JLabel label2 = new JLabel("CenterLeft", SwingConstants.LEFT);
JLabel label3 = new JLabel("TopCenter", SwingConstants.CENTER);
label1.setVerticalAlignment(SwingConstants.BOTTOM);
label2.setVerticalAlignment(SwingConstants.CENTER);
label3.setVerticalAlignment(SwingConstants.TOP);
// Add borders to the labels . . . more on Borders later in the book!
label1.setBorder(BorderFactory.createLineBorder(Color.black));
label2.setBorder(BorderFactory.createLineBorder(Color.black));
label3.setBorder(BorderFactory.createLineBorder(Color.black));
label1.setBounds(10, 10, 200, 150);
// Put it all together . . .
JFrame frame = new JFrame("AlignmentExample");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel p = new JPanel(new GridLayout(3, 1, 8, 8));
p.add(label1);
p.add(label2);
p.add(label3);
p.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
frame.setContentPane(p);
frame.setSize(400, 500);
frame.setVisible(true);
Thanks so much!!change following JLabel1
| |
| |
| |
| JLabel1 |
| |
| |
| |
into following Jlabel1:
| |
| |
| |
| |
| |
| |
| |
JLabel1
Thanks -
How do I view a cube from inside?
Hi,
I made a textured box primative and also a textured indexed quad array cube and I want to be able to view them from the inside. Whenever I program the view to close to the inside I just see black. I thought this might have something to do with the normals but I switched them all around and didn't notice any change. What I want to do is make my texture visible on the inside. Does anyone know how to do this?Thanks but now there seems to be a new problem. I can see the box from the inside like I wanted to but now my texture isn't working right. The box just show up as one solid color. I changed the image that I use for the texture and I got a different color so edleast it does correspond to the image in some way but I want to display the whole image. I did need to modify your code a little to make it work in my program so it's possible I made a mistake somewhere. Here is my version of the code you gave me:
public BranchGroup createBackground()
BranchGroup bg = new BranchGroup();
Transform3D rotateCube = new Transform3D();
TransformGroup rotationGroup = new TransformGroup( rotateCube );
Appearance app = new Appearance();
Texture tex = new TextureLoader( "TechSurface.jpg", this ).getTexture();
app.setTexture( tex );
Box box = new Box(1.0f, 1.0f, 1.0f, Box.ENABLE_APPEARANCE_MODIFY, app);
Shape3D[] face = new Shape3D[6];
PolygonAttributes pa = new PolygonAttributes();
pa.setCullFace(PolygonAttributes.CULL_NONE);
app.setPolygonAttributes(pa);
for(int i = 0; i < 6; i++)
face[i] = box.getShape(i);
face.setAppearance(app);
box.removeAllChildren();
bg.addChild( rotationGroup );
for(int i = 0; i < 6; i++)
rotationGroup.addChild( face[i] );
addLights( bg );
return bg; -
How to obtain reference to IVsBrowseObjectContext from VSPackage?
I've developed small extension that modifies content of csproj files. I follow standard pattern to get the Project object:
var dte = GetGlobalService(typeof(DTE)) as DTE2
var selectedProjects = (Array)dte.ActiveSolutionProjects;
var project = (Project)selectedProjects.GetValue(0);
However Project interface is not sufficient for my purposes (checking items metadata, reinserting items) and I had to fallback to using MSBuild's Project class like this:
var msBuildProject = new Microsoft.Build.Evaluation.Project(project.FullName);
ModifyProjectsContent(msBuildProject);
msBuildProject.Save();
ProjectCollection
.GlobalProjectCollection
.UnloadProject(msBuildProject);
This chunk of code is executed whenever an item is added/renamed/removed to the project.
This works fine however there is caveat - VS detects that file has been changed and prompts to reload project which bad because I want it to happen silently. This approach also does not play well with batch modifications or source control tools. And finally
it is just ugly.
So I decided to check how others are doing it, in particular how does nuget adds its properties. I found out that it uses UncofiguredProject object that retrieve MSBuildProject as following:
var project = .....
var solution = GetGlobalService(typeof(IVsSolution)) as IVsSolution;
IVsHierarchy hierarchy;
solution.GetProjectOfUniqueName(project.GetUniqueName(), out hierarchy);
var context = project as IVsBrowseObjectContext;
if (context == null)
var hierarchy2 = project as IVsHierarchy;
object extObject;
hierarchy2.GetProperty((uint)VSConstants.VSITEMID.Root, (int)__VSHPROPID.VSHPROPID_ExtObject, out extObject))
Project dteProject = extObject as Project;
context = dteProject.Object as IVsBrowseObjectContext;
var unconfiguredProject = context.UnconfiguredProject : null;
After unconfigureProject is obtained reference to msbuild project obtained like following:
var service = unconfiguredProject.ProjectService.Services.ProjectLockService;
using (var x = await service.WriteLockAsync())
await x.CheckoutAsync(unconfiguredProject.FullPath);
ConfiguredProject configuredProject = await unconfiguredProject.GetSuggestedConfiguredProjectAsync();
var buildProject = await x.GetProjectAsync(configuredProject);
// can modify buildProject here
await x.ReleaseAsync();
await Task.Run(() =>
unconfiguredProject.ProjectService.Services.ThreadingPolicy.SwitchToUIThread();
project.Save();
I tried the same approach however I could not obtain IVsBrowseObjectContext from Project reference.
What am I doing wrong? Why the same code works for nuget but does not work for my extension?If you want to obtain a reference to the Package object within VSPackage MSVS extension, you can do something like this:
class MyPackage :
Package
private static
MyPackage _instance;
public static
MyPackage Instance
get
if(_instance
!= null)
_instance
= new MyPackage();
return _instance;
class SomeOtherClass
void Whatever()
// use MyPackage.Instance -
How would you reference respective video from diff class?
Hi. I wanted to get a couple of points of view (if you're willing to look ) on how others would do this because Im not sure where to even start.
I have a buttons class that puts 9 pictures on the stage and each one represents a different movie and leads to that movie when clicked (or will lead there once I figure out how to reference it to the specific movie).
I have 9 movies referenced through XML. And I am using flvPlayer. Currenly I can only have one movie loading. I am not sure how to get each one to play upon click of the respective btn.
Here is some of the code I think is pertinent if figuring how to go about this:
ProjectOneButtons class
//I have each picture loaded through an array and each button is waiting for the right code through a Switch statement:
public function onButtonClick(e:MouseEvent):void {
var releventImageAray:Array = this["rowOfImages" + MovieClip(e.currentTarget).row];
var imageWanted:String = relaventImageArray[MovieClip(e.currentTarget).column];
switch (imageWanted) {
case "Video1" :
//Have not figured out the specific video code in class below
//This switch statement continues for the rest of the buttons.
//this code works but it just loads one movie and so I don't think this is what I need.
projectOneVideos = new projectOneVideos();
addChild(projectOneVideos);
projectOneVideos.x = 0;
projectOneVideos.y = 0;
Here is the ProjectOneVideos class where the videos are loaded and played:
package asFiles.projectOne{
//import statments taken out for post
public class ProjectOneVideos extends Sprite {
public var videoX:Number;
public var videoY:Number;
public var projectOneVideos:XMLList;
public var projectOneTotal:Number;
public var projectOneXML:XML;
public var xmlLoader:URLLoader;
public var player:FLVPlayback;
public var playBtn:VideoPlayBtn;
public var pauseBtn:VideoPauseBtn;
public var videoContainer:MovieClip = new MovieClip;
public function ProjectOneVideos() {
xmlLoader = new URLLoader();
xmlLoader.load(new URLRequest("projectOneVideos.xml"));
xmlLoader.addEventListener(Event.COMPLETE, processXML);
public function processXML(e:Event):void {
projectOneXML = new XML(e.target.data);
projectOneVideos = projectOneXML.VIDEO;
projectOneTotal = projectOneXML.length();
makePlayer();
addButtons();
public function makePlayer():void {
player = new FLVPlayback();
player.skinBackgroundColor = 0x47ABCB;
player.skinBackgroundAlpha = .85;
player.x = 40.3;
player.y = 220;
player.width = 1200;
player.height = 594.2;
videoContainer.addChild(player);
player.addEventListener("complete", backToVideoMenu);
public function addButtons():void {
trace("addButtons initiated");
playBtn = new VideoPlayBtn();
videoContainer.addChild(playBtn);
playBtn.x = 625.6;
playBtn.y = 930;
pauseBtn = new VideoPauseBtn();
videoContainer.addChild(pauseBtn);
pauseBtn.x = 625.6;
pauseBtn.y = 930;
pauseBtn.visible = false;
addChild(videoContainer);
videoContainer.x = 0;
videoContainer.y = 0;
playBtn.addEventListener(MouseEvent.CLICK, playVideo);
pauseBtn.addEventListener(MouseEvent.CLICK, playVideo);
public function playVideo(event:MouseEvent):void {
// this is where I have the video referenced to play.
trace("play/pause button clicked");
if (player.playing || player.paused) {
if (player.paused) {
player.play();
} else {
player.pause();
playBtn.visible = player.paused;
pauseBtn.visible = ! player.paused;
} else if (player.stopped) {
player.play();
playBtn.visible = false;
pauseBtn.visible = true;
} else {
//this will obviously not work because then its just this one movie referenced
player.play("videos/projectOneVideos/videoOne.f4v", 0, false);
pauseBtn.visible = true;
playBtn.visible = false;
The reason I included a bunch of code is to show that there is a play/pause button that is supposed to play the movie. But the thing is I only have the one movie referenced and I am not sure how to have it variable as to which movie is played and make it depend on the button that is clicked from the button class above.
thanks for any input you can give!!!
Note: All of this code works as it is and I am getting no errors.Ok, how about this:
After reviewing my code again, this is what I find.
I process the xml and then never use it when playing the video. To play the video I had just put the path straight to the video and not even used the xml. In the xml.
So I guess my question is how to I refer to the xml to load the video and then when dealing with the buttons lead to the right video from the xml.
kglad: Now I think I see why you were saying define a method of the ProjectOneVideos class that accepts a path/name string to the load target.
I think the code I need to change is:
if (player.playing || player.paused) {
if (player.paused) {
player.play();
} else {
player.pause();
playBtn.visible = player.paused;
pauseBtn.visible = ! player.paused;
} else if (player.stopped) {
player.play();
playBtn.visible = false;
pauseBtn.visible = true;
} else {
//this is the part that needs to be changed to recognize from the xml
player.play("videos/projectOneVideos/videoOne.f4v", 0, false);
pauseBtn.visible = true;
playBtn.visible = false;
But then I have to be able to pull the right video when I hit the button.
So, what tools should I be using? -
How can I open an attachment from inside a PDF portfolio using flex 4.1?
I am currently developing a portfolio and have a DataGrid which lists my sorted attachments.
I can right click on an attachment to open it but I require it to happen on the double click event.
My code currently looks like this (taken from an old example):
private function itemDoubleClicked(event:ListEvent):void
var itemIndex:int = event.rowIndex;
var item:AttachmentImpl = AttachmentImpl(sortedCurrentItems.getItemAt(itemIndex));
var command:CommandImpl = collectionManager.host.commands(acrobat.collection.CommandType.PREVIEW);
Alert.show("you double clicked " + item.fileName);
collectionManager.host.selection = [item];
command.execute(item);
but i get a null pointer exception because command is null.
Could anyone give me pointers or another solution?
Thanks,
Chris.
Edit:
I would like to extend this question as follows:
when using 'host.commands' (as i believe is correct) I get the error that host is 'write-only' and therefore can access none of its methods.
The example I use is from here: http://pdfdevjunkie.host.adobe.com/05_sorting.shtml
Using this method, the host is overwritten by doing the following:
public function set host(host:INavigatorHost):void
if(host != null) {
_host = host;
startEverything();
} else {
_host = null;
//Alert.show("Navigator Ending");
When I try to do this I recieve the error that the method is not set for override.If i try to simply use the host e.g.
host.selection = [item];
It tells me that host is write-only. How can this be true?
Maybe you are looking for
-
Can't launch version 2.1
I've just installed SQL Developer version 2.1 on a Linux box for the first time. The installation appeared to be successful. When I launch sqldeveloper.sh, I'm prompted for the location of my jdk. Once I specify the jdk, the application fails with th
-
Hey there, I've been given a real mixed bag of footage to edit in FCP and I just wanted to ask what the best thing to do is. The files I have are: H264 1280x720 10fps 640x360 25fps 568x320 30fps 1280x720 29.97fps 1280x720 24fps 854x480 29.97fps 564x3
-
Hello, I�m looking for a help. I have an images stored in oracle xe as BLOB data type and i need display theme as i simple gallery. I used this manual : http://fdegrelle.over-blog.com/article-992927.html to display one image - OK, but i have a proble
-
Hi, I was wondering if someone could point me in the right direction. I shot my project using a DCR-TRV 17 Sony Camera. I'm editing in Final Cut Pro 3.0.2. I'm burning dvd's on idvd. My project was shot in 16:9. I edited in 16:9. In FCP it plays in 1
-
Itunes deleted all of my songs
My family got a new computer and i wanted to put itunes on it. When i loaded itunes and plugged my ipod in, itunes deleted every last song i had. what do i do? an how can i get them back?