Edward Posted August 16, 2008 Share Posted August 16, 2008 Hi, I am using a flash movie with a compentent on the canvas at root level called 'myBook'. Within the component I am loading other flash movies. On my root canvas, I have a text field (instance name 'display_txt') and I am able to create a variable called 'res' and display the value of it in my text field using the script below: res = hello; display_txt.text = res; But I can't get the value of it to display inside the embedded movie, in the text field with the instance name 'test_txt'. Does anyone know how to do this? Is my variable available or do I need to make it global? I've tried the following: test_txt.text = res; test_txt.text = _root.res; test_txt.text = _parent.res; test_txt.text = level0.res; Thanks for any help you can offer. Link to comment https://forums.phpfreaks.com/topic/119958-retrieving-a-variable-from-a-parent-movie-in-flash/ Share on other sites More sharing options...
Edward Posted August 16, 2008 Author Share Posted August 16, 2008 I've now managed to get it work but not completely. I was defining my variable within a function so it wasn't global. My defining it outside a function I am able to access it with the following code. test_txt.text = _root.current_page; However, I NEED to define the 'current_page' variable within a function. How can I do this but still make it global? Link to comment https://forums.phpfreaks.com/topic/119958-retrieving-a-variable-from-a-parent-movie-in-flash/#findComment-617960 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.