ขั้นแรก สร้างไฟล์ข้อความชื่อ test.xml แล้วใส่ข้อความตามด้านล่าง
First, create XML file named test.xml and add text as below
- <document>
- <head>Header</head>
- <body>
- <content>
- <no>1</no>
- <text>Content 1</text>
- </content>
- <content>
- <no>2</no>
- <text>Content 2</text>
- </content>
- </body>
- <foot>Footer</foot>
- </document>
- CvCapture* capture=cvCreateFileCapture("E:/Wildlife.wmv");
- IplImage* img;
- char c;
- double frame_width=cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH );
- double frame_height=cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_HEIGHT );
- double fps=cvGetCaptureProperty(capture,CV_CAP_PROP_FPS );
- printf("%f %f %f",frame_width, frame_height,fps);
- cvNamedWindow("test",1);
- img=cvQueryFrame(capture);
- while(img){
- cvShowImage("test",img);
- c=cvWaitKey(30);
- if(c==27)
- break;
- img=cvQueryFrame(capture);
- }
- cvReleaseCapture(&capture);
- CvCapture* capture=cvCreateCameraCapture(0);
- IplImage* img;
- char c;
- cvNamedWindow("test",1);
- while(true){
- img=cvQueryFrame(capture);
- cvShowImage("test",img);
- c=cvWaitKey(30);
- if(c==27)
- break;
- }
- cvReleaseCapture(&capture);
ในคอนสตรัคเตอร์ของคลาส movie clip ให้ใส่โค้ดตามด้านล่าง
In the constructor of movie clip class, add the code as below
- var loader:Loader = new Loader();
- loader.load(new URLRequest('image path'));
- addChild(loader);
รูปภาพจะถูกโหลดจาก image path และถูกใส่เป็น child ใน movie clip นี้
The image will be loaded from image path and added to be child of this movie clip
หมายเหตุ: อย่าลืม import flash.net.URLRequest;
Notice: you must import flash.net.URLRequest;
ขั้นแรก สร้างไฟล์ข้อความชื่อ line2array.txt แล้วใส่ข้อความตามด้านล่าง
First, create text file named line2array.txt with add text below
facebook
twitter
google plus
internet explorer
html5
ขั้นแรก สร้างไฟล์ข้อความชื่อ variables.txt แล้วใส่ข้อความตามด้านล่าง
First, create text file named variables.txt with add text below
myTitle=Test&myBody=This is test&myURL=www.google.com
รูปแบบของข้อความจะเป็น ชื่อตัวแปร=ค่าของตัวแปร และคั่นด้วยเครื่องหมาย &
The format will be variable_name=variable_value and separated by &