From: Nutchanon Wetchasit <Nutchanon.Wetchasit@gmail.com>
Subject: Make GetVariable() plugin function use internal ActionGetVariable implementation.
Bug: https://savannah.gnu.org/bugs/?42395

This fixes variable path notation issue of bug #42395.
See <https://savannah.gnu.org/bugs/?42395>

diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index c9ce412..314a85b 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -1596,9 +1596,13 @@ movie_root::processInvoke(ExternalInterface::invoke_t *invoke)
         MovieClip *mc = getLevel(0);
         as_object *obj = getObject(mc);
         VM &vm = getVM();
+        as_environment timeline = mc->get_environment();
+        as_environment::ScopeStack scope;
+        as_object *container = NULL;
         std::string var = invoke->args[0].to_string();
-        as_value val;
-        if (obj->get_member(getURI(vm, var), &val)) {
+        scope.push_back(obj);
+        as_value val = getVariable(timeline, var, scope, &container);
+        if (container != NULL) {
             // If the variable exists, GetVariable returns a string
             // representation of its value. Variable with undefined
             // or null value counts as exist too.
