Problem: Unable to call a function in parent swf from the child swf.
I am working on a site right now that has a parent loader
(all it contains are the menu bar [which is as3 tweened] and the
functions for calling all of the other pages.) The problem that I
am having right now, are some of the internal or child pages, need
to call functions that are in the parent loader. For what ever
reason, I am unable to do any of that.
I have attached the code so you can look at that.
Let me see if I can explain it any better.
The code I just posted is for the Main Stage swf called
loader.swf. It has the menu, and all the functions that control the
menu's movement and when to load all the other swfs. The easiest
way for me to ask this, is to show you.
click
http://dev.locallinux.com/mystictan/layout2.html
When you get there, you will see the menu bar, and it is
loading home.swf onto the stage behind the menu.
Mouse over "The Perfect Tan" and click on "1: Base"
You will notice it just loaded a new swf called ptbase.swf.
Well in that swf is a button for "Products" That button
basically needs to take you to "Products > 1: Base" on the menu
(not working yet, I know. But theres no point in me making that,
until I could get this working"
What I would like is when you click on "Products" in
ptbase.swf, it calls the function clickedProductsBase(), which does
its thing. But that function is back in the loader.swf. Does that
make sence?
What am I missing here?
RyanORo, thank you very much for your response.
I try that, and I get this sort of error when I click on it:
TypeError: Error #1006: fwd is not a function.
at ptbase_fla::MainTimeline/testing()
I know all that code that I posted was a bith much, but here
is the movie loading part:
function loadComplete(event:Event):void
loaderbar.visible = false;
mainbody.removeChild(thisMC);
thisMC = MovieClip(myloader.content);
myloader.unload();
mainbody.addChild(thisMC);
thisMC.gotoAndStop(1);
TransitionManager.start(thisMC, {type:Fade,
direction:Transition.IN, duration:5, easing:Strong.easeOut});
mainbody is an empty mc under the menu, so that the loaded
swf file appears under the menu.
You know what, scratch all that . *MOOWHA* I could KISS you
right now. "(parent as MovieClip).clickedProductsBase()" did not
work because it was calling it out of the wrong parent. Just did
"(this.parent.parent as MovieClip).clickedProductsBase()" and that
did the magic I needed. Thanks...
Similar Messages
-
Calling a Function in the Parent Window from the Child Window
QUESTION: How do I call a function resident in the parent
window from a child window?
BACKGROUND
I have a JavaScript function resident in the parent window
that reformats information obtained from the Date object and writes
the result to the parent window using the document.write( ) method.
I would like to call this function from the child window and have
it write to the child window instead. Is this possible? If not,
must I rewrite the entire function and nest it in the below code?
If so, what is the proper form of nesting?
CODE: The code that creates and fills the child window is
provided below. The highlighted area indicates where I would like
to enter the information from the function resident in the parent
window. I have tried every imaginable permutation of code that I
can imagine and nearly destroyed my parent document in the process.
I am very happy that I had a back-up copy!
function openCitationWindow() {
ciDow = window.open("", "", "width=450, height=175, top=300,
left=300");
ciDow.document.write("A proper way to cite a passage of text
on this page:<br /><br />Stegemann, R. A. 2000.
<cite>Imagine: Bridging a Historical Gap</cite>. " +
document.title + ". [<a href='" + location.href + "'
target='_blank'>online book</a>] <" + location.href
+ "> (");
MISSING CODE;
ciDow.document.write(").<br /><br /><input
type='button' value='Close Window' onclick='window.close()'>");
ciDow.focus();Never mind - I was doing something very stupid and wasn't
calling the function as a method of a movie clip. I was simply
calling checkTarget(event) rather than
event.currentTarget.checkTarget(event); which seems to work. -
How to call a function in a class from the main timeline?
Hey Guys
I have a project in Flash with four external AS files, which are linked to items in the library using AS linkage.
What I want to do is call a function in one of these files from the main timeline, how would I go about doing this? I'm not currently using a document class, most of the code is in Frame 1 of the main timeline.
Thanks// change type to the class name from the instance
ClassNameHere(this.getChildByName('instance_name')).SomeFunction(); -
How to call the grand parent constructor from the child ??
Hi All,
I am having 3 classes.
Class A.
Class B extends Class A.
Class C extends Class A
i need to call the constructor of ClassA from Class C. how to call ??
Thanks,
J.KathirEach class will implicitly call the parent default constructor if you do not call it in the code ie
super();However you can call any of the parent constructors ie
class Parent {
int value;
Parent(int v) {
value = v;
public void display() {
System.out.println(value);
class Child extends Parent {
Child(int v) {
super(v);
public static void main(String[] args) {
Child c = new Child(10);
c.display();
} -
Is it possible to call a function in a parent component from a child component in Flex 3?
This is probably a very basic question but have been wondering this for a while.
I need to call a function located in a parent component and make the call from its child component in Flex 3. Is there a way to access functions in a parent component from the child component? I know I can dispatch an event in the child and add a listener in the parent to call the function, but just wanted to know if could also directly call a parent function from a child (similar to how you can call a function in the main mxml file using Application.application). ThanksThere are no performance issues, but it is ok if you are using the child component in only one class. Suppose if you want to use the same component as a child to some bunch of parents then i would do like the following
public interface IParentImplementation{
function callParentMethod();
and the parent class should implement this 'IParentImplementation'
usually like the following line
public class parentClass extends Canvas implements IParentImplementation{
public function callParentMethod():void{
//code
in the child you should do something like this.
(this.parent as IParentImplementation).callParentMethod();
Here using the Interfaces, we re decoupling the parent and the child
If this post answers your question or helps, please mark it as such. -
Calling a method in Parent component from Title Window
Hi all,
I have a parent component that opens up a Title window when I
click a button. Now I want to call a method in that parent
component from the Title window. How do I do this in Flex? Could
anyone give me a hint please.
Thank you in advance for the help"happybrowndog" <[email protected]> wrote in
message
news:gctmql$4t5$[email protected]..
> That's goddamned ridiculous. What were Flex developers
thinking that you
> have
> to write a custom event to call back to a parent
component?? Other GUI
> libraries such as WxWidgets, Fox, Qt, Delphi, MFC,
WinForms, etc., all
> allow
> you to either call via a reference to the parent object
or submit a
> callback
> function into the child object. That's just basic OO
programming. Flex
> is
> looking more and more ridiculous and more like Swing -
tons of unnecessary
> coding to do simple things.
You absolutely _do_ have the capability to pass in a
reference to the parent
component, or to create a "hard" reference to
Application.application. But
these are not recommended practices, because anything you
create this way is
then tied to an environment that implements those properties
and methods.
Q (3): I want to run a function in my main application from
inside my
custom component. But when I try to refer to myFunction() in
that
component, I get a compile time error Call to a possibly
undefined function
myFunction. How can I fix this?
A: Your component has its own scope, so it doesn't know
anything
about the functions in the main file. You can get around this
by directly
referencing the main application scope like this:
Application.application.myFunction(). However, this makes
your component
tightly coupled, which is a quick way of saying that your
component is only
usable in an application that has a myFunction() function in
it. You're
better off dispatching an event from your component and
letting the
application decide how to handle it. For more information,
check out the
following resources:
http://www.adobe.com/devnet/flex/articles/loose_coupling.html
http://www.adobe.com/devnet/flex/articles/graduating_pt1.html
From
http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf -
My iphone 4S has problem in making and receiving the calls. While making the call , call fails and netwrok disappears. Like wise no voice is heard for incoming calls. This happened after return from the overseas travel.
Hello SamSax
Check out the assist page below for troubleshooting call connectivity.
Calls and connection issues
http://www.apple.com/support/iphone/assistant/calls/
Thanks for using Apple Support Communities.
Regards,
-Norm G. -
Call a function inside a package from a stored procedure
Hello:
I am kind of new to the stored procedure. Does anyone know how to call a function inside a package from another stored procedure?
I have a existing function (func_b) inside a package (pack_a) and it returns a cursor. I want to call this function from a stored procedure (proc_c) so that I use the data inside the cursor.
can I do the following in proc_c:
my_cursor1 SYS_REFCURSOR;
begin
my_cursor1 := exec pack_a.func_b
end
It will be very helpful if anyone can point me to any reading or example. Thank you very much for your information.guys:
Thank you for your information so far. I need some more help here. I was able to run the function in my stored procedure. However, I was not able to print the result on the screen to view the cursor result, although I am using dbms_output.put_line statement inside my stored procedure.
I use the following statement to execute my stored procedure on sql*plus. I can tell the stored procedure is executed successfully, but I did see anything printed:
DECLARE TEMP VARCHAR2(100);
BEGIN PROC_LAWS_CAD_NAME_SEARCH('LPD', 'TEST DEVICE ID', 'TEST LAST NAME', 'TEST FIRST NAME', 'F', '11112009', TEMP); END;
I tried to use 'set serveroutput on' and got the following error:
ERROR:
ORA-06502: PL/SQL: numeric or value error: host bind array too small
ORA-06512: at line 1
I am kind of confused now. thank you for your help.
Jack
Here is my procedure:
create or replace
PROCEDURE PROC_SEARCH
( AGENCY_ID IN VARCHAR2,
DEVICE_ID IN VARCHAR2,
L_NAME IN VARCHAR2,
F_NAME IN VARCHAR2,
SEX IN VARCHAR2,
DOB IN VARCHAR2,
CAD_NAME_SCH_RESULT_STR OUT VARCHAR2)
AS
v_agy_id varchar2(10);
v_device_id varchar2(20);
v_l_name varchar2(25);
v_f_name varchar2(15);
v_sex varchar2(1);
v_dob date;
-- this cursor is going to be used to store a list of warrant matching
-- name search criteria
cad_srch_cursor sys_refcursor;
objSrch SEARCH_RESULT_TEMP%ROWTYPE;
BEGIN
cad_srch_cursor := SEARCH_PKG.SEARCH('TESTING', 'TESTER', null, null,null, null, getPhonetic('TESTING'));
LOOP
FETCH cad_srch_cursor INTO objSrch;
EXIT WHEN cad_srch_cursor%NOTFOUND;
--insert into SEARCH_RESULT_TEMP (name_last) values (objSrch.name_last);
CAD_NAME_SCH_RESULT_STR := objSrch.name_last;
dbms_output.put_line('First:'||objSrch.name_first||':Last:'||objSrch.name_last||':Middle:'||objSrch.name_middle);
end LOOP;
END PROC_LAWS_SEARCH;
----------------------------------------- -
I am getting error Error in calling up function 'BAPI_APOATP_CHECK' in APO server The current application triggered a termination
when triggering for gatp.Hi Virender,
This error can be experienced due to many reasons. based on my experience below reasons can cause this issue.
1) If you are using allocation check if allocation is correctly set.
2) In case you are using custom enhancements / user exits (in SD / GATP / CIF) check if any of them, causing this issue.
In my case correction of allocation setup could resolve this issue, so check what is the reason in your case.
Rgds
Sourabh -
So what is up with this error message in Muse?
MuseJSAssert: Error calling slector function:SecurityError: Failed to read the ‘contentDocument’ property from ‘HTMLIFrameElement’: Blocked a frame with orign “null” from accessing a cross-origin frame.This is a genuine security error generated by the browser when viewing a page with iFrame content locally.
Please refer to Zak's reply in the following thread: https://forums.adobe.com/message/6496180#6496180
Cheers,
Vikas -
I have just bought iphone 4 and when I make calls i don't hear anything from the headset excep when i plug in the headphones or turn on speaker ?
I have the same problem. It only started a few days ago. When I make or receive calls I have to use speaker otherwise I can't hear a thing. I'm also pretty sure that when I try to make calls without the speaker turned on, it doesn't actually dial, but the display says it has.
I've tried restoring from a backup with no luck. I'm reluctant to restore as a new phone as it's such a pain. -
I have a problem with my itunes. I cannot transfer apps from the itunes to my iphone 4s. Any time I try to snyc itunes tells me "The iphone could not be synced because this computer is no longer authorized for purchased items that are on this iphone. To authorize this computer for items purchased from the itunes store, choose, Store > Authorize This Computer. But anytime I authorize it tells me you have authorized including this computer 2 out 5 computers. And if I try again the same story over and over again. But I have many apps on my itunes which I want to transfer. Please someone help me.
Well Authorize the Computer...........
-
i have a game called dino island that i downloaded from the app store it wont work after i click on an island why can you help?
See:
iOS: Troubleshooting applications purchased from the App Store
Contact the developer/go to their support site
Restore from backup. See:
iOS: How to back up
Restore to factory settings/new iPod -
TS1702 Having problems with Security questions to be able to download from the iTunes store
Having problems with Security questions to be able to download from the iTunes store
Security questions
Read this note for information on how to reset the security questions http://support.apple.com/kb/HT5312
This user tip may also help you Security Questions -
My new iphone 5s doesn't have any volume when I call someone. I can see from the screen that it is calling them, but I cannot hear anything. Also when they answer my call, I cannot hear them.
Turn the volume up... in call volume and sounds (ring, notifications, etc) are seperate volume controls.
Maybe you are looking for
-
How can I get updated data in sub VI in real time?
Hello. I'm making application using Labview 7.0. What I want to do is the data acquisition changing some parameters. I get the data each time I changed variable parameters. I can do it in sub VI by inserting array component into 'for' loop. As loop i
-
ITunes 10.1.2 and Store
I just updated to iTunes 10.1.2 and now the Apple iTunes Stores seems to be flaky. It will load some times, hang and get beach ball o'death, or come back and say unavailable. My downloads are responding in a similar manner. I was notified through e-m
-
I can't access my iPhoto..what should i do?
i access my iphoto..what should i do?
-
Hello Gurus, I have a table with 3 Cols No , Id , Name where ( No , ID ) is a compsite key and the data looks like this No , Id , Name 1 2 A 1 3 B 1 4 C i want a SQL Query which displays data like this No Id Name 1 2 A 3 B 4 C Help will be really app
-
Imy ipad is disabled and I can not remember passcode